()
| 41 | const SidebarContext = React.createContext<SidebarContext | null>(null) |
| 42 | |
| 43 | function useSidebar() { |
| 44 | const context = React.useContext(SidebarContext) |
| 45 | if (!context) { |
| 46 | throw new Error('useSidebar must be used within a SidebarProvider.') |
| 47 | } |
| 48 | |
| 49 | return context |
| 50 | } |
| 51 | |
| 52 | const SidebarProvider = React.forwardRef< |
| 53 | HTMLDivElement, |