Add toast for error messages, fix #16
This commit is contained in:
1
src/lib/assets/error-warning-fill.svg
Normal file
1
src/lib/assets/error-warning-fill.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 15V17H13V15H11ZM11 7V13H13V7H11Z" fill="#000"></path></svg>
|
After Width: | Height: | Size: 268 B |
8
src/lib/errorToast.ts
Normal file
8
src/lib/errorToast.ts
Normal 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']
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user