import { jsx as _jsx } from "react/jsx-runtime";
import * as React from 'react';
import { InnerContext } from "../../../../context/innerContext/index.js";
import { usePCEditorChildrenItemWrap } from "../../../../hooks/usePCEditorChildrenItemWrap.js";
import './ConstructorBlock.css';
export const ConstructorBlock = ({ index = 0, data, children, }) => {
    const { blockRef } = usePCEditorChildrenItemWrap(index);
    const { blockWrappers = [] } = React.useContext(InnerContext);
    const wrappedContent = blockWrappers.reduce((content, { wrapper: Wrapper, props }) => (_jsx(Wrapper, { type: data.type, props: props, content: data, index: index, children: content })), children);
    return _jsx("div", { ref: blockRef, children: wrappedContent });
};
//# sourceMappingURL=ConstructorBlock.js.map
