import { useEffect, useState } from 'react';
import { useStyleConfig } from '../core';
import { useSidemenuContext } from './context';
const useSidemenuItem = (isExpanded) => {
    const [isExpandedVertically, setIsExpandedVertically] = useState(isExpanded);
    const { variant, size, isExpandedHorizontally } = useSidemenuContext();
    const styles = useStyleConfig('Sidemenu', useSidemenuContext);
    useEffect(() => {
        if (isExpanded !== isExpandedVertically)
            setIsExpandedVertically(isExpanded);
    }, [isExpanded]);
    return {
        isExpandedVertically,
        isDark: variant === 'dark',
        size,
        isExpandedHorizontally,
        styles,
        setIsExpandedVertically,
    };
};
export default useSidemenuItem;
//# sourceMappingURL=useSidemenuItem.js.map