const SIDENAV_CONTEXT_KEY = Symbol('sidenav-context'); export interface SidenavContext { isHovered: Readonly>; sidebarWidth: Readonly>; isOpen: Readonly>; close: () => void; } export const provideSidenavContext = (context: SidenavContext) => { provide(SIDENAV_CONTEXT_KEY, context); }; export const useSidenavContext = (): SidenavContext => { const context = inject(SIDENAV_CONTEXT_KEY); if (!context) { throw new Error('useSidenavContext must be used within a Sidenav provider'); } return context; };