"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "ExtensionSlot", {
    enumerable: true,
    get: function() {
        return ExtensionSlot;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _react = require("react");
const _registry = require("./registry");
const ExtensionSlot = (props)=>{
    const { position, scope, ...rest } = props;
    // const [component, setComponent] = useState<ReactNode | null>(null);
    const Ele = (0, _react.useMemo)(()=>{
        const registry = _registry.OrderlyExtensionRegistry.getInstance();
        const plugin = registry.getPluginsByPosition(position);
        // if (plugin) {
        //   setComponent(plugin.render({}));
        // }
        return plugin?.render;
    }, []);
    return /*#__PURE__*/ (0, _jsxruntime.jsx)(_react.Fragment, {
        children: Ele ? /*#__PURE__*/ (0, _jsxruntime.jsx)(Ele, {
            ...rest
        }) : null
    });
};

//# sourceMappingURL=slot.js.map