Skip to content
File

Blob: src/client/toast/toast-context.ts

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