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

29 lines
585 B
TypeScript

"use client"
import { createContext, useContext } from "react"
type AppointmentContextValue = {
id: string
label: string
}
const AppointmentContext = createContext<AppointmentContextValue | null>(null)
export function AppointmentProvider({
appointment,
children,
}: {
appointment: AppointmentContextValue
children: React.ReactNode
}) {
return (
<AppointmentContext.Provider value={appointment}>
{children}
</AppointmentContext.Provider>
)
}
export function useAppointment() {
return useContext(AppointmentContext)
}