File size: 382 Bytes
3df1e9f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { Toaster, type AddToastProps } from "melt/builders";

export type ToastData = {
	title: string;
	description: string;
	variant: "success" | "warning" | "error";
};

export const toaster = new Toaster<ToastData>({});

export function addToast(args: AddToastProps<ToastData>) {
	toaster.addToast(args);
}

export function removeToast(id: string) {
	toaster.removeToast(id);
}