import { jsx as _jsx } from "react/jsx-runtime";
import { createContext, useContext, useMemo, useState } from "react";
export const LayoutContext = /*#__PURE__*/ createContext({});
export const LayoutProvider = (props)=>{
    const context = useContext(LayoutContext);
    const isTopLevel = useMemo(()=>!context.isTopLevel, []);
    const [siderWidth, setSiderWidth] = useState(0);
    const [headerHeight, setHeaderHeight] = useState(0);
    const [footerHeight, setFooterHeight] = useState(0);
    const [pageHeaderHeight, setPageHeaderHeight] = useState(0);
    const [pageFooterHeight, setPageFooterHeight] = useState(0);
    return /*#__PURE__*/ _jsx(LayoutContext.Provider, {
        value: {
            siderWidth,
            headerHeight: isTopLevel ? headerHeight : context.headerHeight,
            footerHeight: isTopLevel ? footerHeight : context.footerHeight,
            setSiderWidth,
            setHeaderHeight,
            setFooterHeight,
            pageHeaderHeight,
            pageFooterHeight,
            setPageHeaderHeight,
            setPageFooterHeight,
            isTopLevel
        },
        children: props.children
    });
};

//# sourceMappingURL=layoutContext.js.map