()
| 19 | const ToastContext = createContext<ToastContextValue | null>(null); |
| 20 | |
| 21 | export const useToast = () => { |
| 22 | const context = useContext(ToastContext); |
| 23 | if (!context) { |
| 24 | throw new Error('useToast must be used within ToastProvider'); |
| 25 | } |
| 26 | return context; |
| 27 | }; |
| 28 | |
| 29 | interface ToastProviderProps { |
| 30 | children: ReactNode; |