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

29 lines
549 B
TypeScript

"use client"
import { createContext, useContext } from "react"
type EstimateContextValue = {
id: string
label: string
}
const EstimateContext = createContext<EstimateContextValue | null>(null)
export function EstimateProvider({
estimate,
children,
}: {
estimate: EstimateContextValue
children: React.ReactNode
}) {
return (
<EstimateContext.Provider value={estimate}>
{children}
</EstimateContext.Provider>
)
}
export function useEstimate() {
return useContext(EstimateContext)
}