mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-10 08:07:03 +00:00
* expose react sdk * expose react sdk * iterate * iterate * iterate * nit * update example * update example * small fixes * update all
34 lines
580 B
TypeScript
34 lines
580 B
TypeScript
import Toast from '$lib/components/Toast.svelte'
|
|
import { toast } from '@zerodevx/svelte-toast'
|
|
|
|
export type ToastAction = {
|
|
label: string
|
|
callback: () => void
|
|
}
|
|
|
|
export function sendUserToast(
|
|
message: string,
|
|
error: boolean = false,
|
|
actions: ToastAction[] = [],
|
|
errorMessage: string | undefined = undefined
|
|
): void {
|
|
toast.push({
|
|
component: {
|
|
src: Toast,
|
|
props: {
|
|
message,
|
|
error,
|
|
actions,
|
|
errorMessage
|
|
},
|
|
sendIdTo: 'toastId'
|
|
},
|
|
dismissable: false,
|
|
initial: 0,
|
|
theme: {
|
|
'--toastPadding': '0',
|
|
'--toastMsgPadding': '0'
|
|
}
|
|
})
|
|
}
|