"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "Sider", {
    enumerable: true,
    get: function() {
        return Sider;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _react = require("react");
const _layoutContext = require("./layoutContext");
const _reactslot = require("@radix-ui/react-slot");
const Sider = (props)=>{
    const ref = (0, _react.useRef)(null);
    const { asChild, ...rest } = props;
    const { setSiderWidth } = (0, _react.useContext)(_layoutContext.LayoutContext);
    (0, _react.useEffect)(()=>{
        const boundingClientRect = ref.current?.getBoundingClientRect();
        if (boundingClientRect && boundingClientRect.height) {
            setSiderWidth(boundingClientRect.width);
        }
    }, []);
    const Comp = asChild ? _reactslot.Slot : "div";
    return /*#__PURE__*/ (0, _jsxruntime.jsx)(Comp, {
        ...rest,
        ref: ref
    });
};
Sider.displayName = "Sider";

//# sourceMappingURL=sider.js.map