import { jsx as _jsx } from "react/jsx-runtime";
import { Fragment, useMemo } from "react";
import { OrderlyExtensionRegistry } from "./registry";
export const ExtensionSlot = (props)=>{
    const { position, scope, ...rest } = props;
    // const [component, setComponent] = useState<ReactNode | null>(null);
    const Ele = useMemo(()=>{
        const registry = OrderlyExtensionRegistry.getInstance();
        const plugin = registry.getPluginsByPosition(position);
        // if (plugin) {
        //   setComponent(plugin.render({}));
        // }
        return plugin?.render;
    }, []);
    return /*#__PURE__*/ _jsx(Fragment, {
        children: Ele ? /*#__PURE__*/ _jsx(Ele, {
            ...rest
        }) : null
    });
};

//# sourceMappingURL=slot.js.map