"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const react_1 = require("react");
const core_1 = require("../core");
const context_1 = require("./context");
const useSidemenuItem = (isExpanded) => {
    const [isExpandedVertically, setIsExpandedVertically] = (0, react_1.useState)(isExpanded);
    const { variant, size, isExpandedHorizontally } = (0, context_1.useSidemenuContext)();
    const styles = (0, core_1.useStyleConfig)('Sidemenu', context_1.useSidemenuContext);
    (0, react_1.useEffect)(() => {
        if (isExpanded !== isExpandedVertically)
            setIsExpandedVertically(isExpanded);
    }, [isExpanded]);
    return {
        isExpandedVertically,
        isDark: variant === 'dark',
        size,
        isExpandedHorizontally,
        styles,
        setIsExpandedVertically,
    };
};
exports.default = useSidemenuItem;
//# sourceMappingURL=useSidemenuItem.js.map