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

29 lines
549 B
TypeScript

"use client"
import { createContext, useContext } from "react"
type CustomerContextValue = {
id: string
label: string
}
const CustomerContext = createContext<CustomerContextValue | null>(null)
export function CustomerProvider({
customer,
children,
}: {
customer: CustomerContextValue
children: React.ReactNode
}) {
return (
<CustomerContext.Provider value={customer}>
{children}
</CustomerContext.Provider>
)
}
export function useCustomer() {
return useContext(CustomerContext)
}