"use client" import * as React from "react" export interface SidebarConfig { variant: "sidebar" | "floating" | "inset" collapsible: "offcanvas" | "icon" | "none" side: "left" | "right" } export interface SidebarContextValue { config: SidebarConfig updateConfig: (config: Partial) => void } export const SidebarContext = React.createContext(null) export function SidebarConfigProvider({ children }: { children: React.ReactNode }) { const [config, setConfig] = React.useState({ variant: "inset", collapsible: "offcanvas", side: "left" }) const updateConfig = React.useCallback((newConfig: Partial) => { setConfig(prev => ({ ...prev, ...newConfig })) }, []) return ( {children} ) } export function useSidebarConfig() { const context = React.useContext(SidebarContext) if (!context) { throw new Error("useSidebarConfig must be used within a SidebarConfigProvider") } return context }