Add toast for error messages, fix #16

This commit is contained in:
2023-04-07 11:54:54 +02:00
parent 95e9b8cabf
commit 94e749960f
8 changed files with 70 additions and 317 deletions

8
src/lib/errorToast.ts Normal file
View File

@ -0,0 +1,8 @@
import errorIcon from '$lib/assets/error-warning-fill.svg';
import { toast } from '@zerodevx/svelte-toast';
export function errorToast(message: string): number {
return toast.push(`<img src="${errorIcon}" />${message}`, {
classes: ['error']
});
}