File size: 373 Bytes
a5619c2
3df1e9f
 
 
 
 
 
 
22dad9f
 
 
3df1e9f
e48cc8b
 
3df1e9f
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { Toaster } from "melt/builders";

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

export const toaster = new Toaster<ToastData>({
	hover: "pause-all",
});

export function addToast(data: ToastData) {
	toaster.addToast({ data });
}

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