/**
 * Main Entry Point
 * 
 * Blocks are now built dynamically via webpack.config.js
 * This file is for global styles and common logic.
 */
import './style.scss';
import './editor.scss';
// import './template-library';

import { createHigherOrderComponent } from '@wordpress/compose';
import { addFilter } from '@wordpress/hooks';

const withAwtWrapper = createHigherOrderComponent((BlockListBlock) => {
    return (props) => {
        // শুধুমাত্র awt/ দিয়ে শুরু হওয়া ব্লকগুলোতে র‍্যাপার দিবে
        if (props.name.startsWith('awt/')) {
            return (
                <div className="awt-wrapper">
                    <BlockListBlock {...props} />
                </div>
            );
        }
        return <BlockListBlock {...props} />;
    };
}, 'withAwtWrapper');

addFilter(
    'editor.BlockListBlock',
    'awt/with-wrapper',
    withAwtWrapper
);