File
Blob: src/client/toast/toast-context.ts
| 1 | import { createContext } from "react"; |
| 2 | |
| 3 | export type ToastTone = "success" | "error" | "info"; |
| 4 | |
| 5 | export interface Toast { |
| 6 | id: string; |
| 7 | tone: ToastTone; |
| 8 | title: string; |
| 9 | message?: string; |
| 10 | } |
| 11 | |
| 12 | export interface ToastContextValue { |
| 13 | pushToast(input: Omit<Toast, "id">): void; |
| 14 | } |
| 15 | |
| 16 | export const ToastContext = createContext<ToastContextValue | null>(null); |