Files
lab/src/contexts/sidebar-context.tsx
T
kovakmedya cb150f7a24 init: lab project bootstrapped from isletmem-kovakcrm
- CRM domain modules removed (customers, services, software, calendar, tasks, invoices, leads, finance, etc.)
- DLS branding: package name=lab, logo wordmark, sidebar nav, header CTA
- Tenant layer extended with kind dimension (lab|clinic) + requireTenantKind helper
- Schema rewritten for DLS domain: jobs, job_files, job_status_history, prosthetics, connections, finance_entries, notifications
- Onboarding form: clinic/lab account-type selection + auto-generated memberNumber
- Placeholder routes for jobs/{inbound,outbound,new}, products, finance, connections
- PDF spec + spec.md under belgeler/
- db: lab database + 13 collections + indexes + storage bucket (job-files) provisioned via Appwrite MCP

Ref: belgeler/dls-ui-tasarim.pdf
2026-05-21 18:28:38 +03:00

43 lines
1.1 KiB
TypeScript

"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<SidebarConfig>) => void
}
export const SidebarContext = React.createContext<SidebarContextValue | null>(null)
export function SidebarConfigProvider({ children }: { children: React.ReactNode }) {
const [config, setConfig] = React.useState<SidebarConfig>({
variant: "inset",
collapsible: "offcanvas",
side: "left"
})
const updateConfig = React.useCallback((newConfig: Partial<SidebarConfig>) => {
setConfig(prev => ({ ...prev, ...newConfig }))
}, [])
return (
<SidebarContext.Provider value={{ config, updateConfig }}>
{children}
</SidebarContext.Provider>
)
}
export function useSidebarConfig() {
const context = React.useContext(SidebarContext)
if (!context) {
throw new Error("useSidebarConfig must be used within a SidebarConfigProvider")
}
return context
}