import { jsx as _jsx } from "react/jsx-runtime";
import * as React from 'react';
import { BlockIdContext } from "../../../../context/blockIdContext/index.js";
import { InnerContext } from "../../../../context/innerContext/index.js";
import { BlockDecoration } from "../../../../customization/BlockDecoration.js";
export const ConstructorItem = ({ data, blockKey, children, }) => {
    const { itemMap } = React.useContext(InnerContext);
    const { type, ...rest } = data;
    const Component = itemMap[type];
    return (_jsx(BlockIdContext.Provider, { value: blockKey, children: _jsx(Component, { ...rest, children: children }) }));
};
export const ConstructorHeader = ({ data, blockKey, }) => (_jsx(BlockDecoration, { type: data.type, children: _jsx(ConstructorItem, { data: data, blockKey: blockKey }, data.type) }));
//# sourceMappingURL=ConstructorItem.js.map
