import { jsx } from "react/jsx-runtime";
import { createContext, useEffect, useState } from "react";
import { useCurrentUserContext, useCurrentUserSettingsMenu } from "../../user/index.mjs";
import { useTabSettings } from "./useTabSettings.mjs";
const PageStyleContext = /*#__PURE__*/ createContext({
    style: 'classical'
});
const PageStyleProvider = (param)=>{
    let { children } = param;
    var _currentUser_data_data_systemSettings, _currentUser_data_data, _currentUser_data;
    const currentUser = useCurrentUserContext();
    const tabItem = useTabSettings();
    const [items, setItems] = useState([]);
    const { addMenuItem } = useCurrentUserSettingsMenu();
    useEffect(()=>{
        addMenuItem(tabItem, {
            before: 'divider_3'
        });
    }, [
        addMenuItem,
        tabItem
    ]);
    return /*#__PURE__*/ jsx(PageStyleContext.Provider, {
        value: {
            style: (null == currentUser ? void 0 : null == (_currentUser_data = currentUser.data) ? void 0 : null == (_currentUser_data_data = _currentUser_data.data) ? void 0 : null == (_currentUser_data_data_systemSettings = _currentUser_data_data.systemSettings) ? void 0 : _currentUser_data_data_systemSettings.pageStyle) || 'classical',
            items,
            setItems
        },
        children: children
    });
};
export { PageStyleContext, PageStyleProvider };
