garage-erp/apps/dashboard/modules/inspections/inspection-context.tsx
2026-04-06 02:32:47 +03:00

29 lines
573 B
TypeScript

"use client"
import { createContext, useContext } from "react"
type InspectionContextValue = {
id: string
label: string
}
const InspectionContext = createContext<InspectionContextValue | null>(null)
export function InspectionProvider({
inspection,
children,
}: {
inspection: InspectionContextValue
children: React.ReactNode
}) {
return (
<InspectionContext.Provider value={inspection}>
{children}
</InspectionContext.Provider>
)
}
export function useInspection() {
return useContext(InspectionContext)
}