mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-05 16:03:47 +00:00
* feat: improve drafts and diffs * feat: add scripts diff button * fix: remove diff drawer in scripts/add * fix: nits * feat: diffs for flows and apps w/ deep comparison * fix: flow preview buttons height * fix: use ordered json stringify * fix: code view * fix: temp flow diffs * fix: flow diffs merge conflict
36 lines
620 B
TypeScript
36 lines
620 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,
|
|
duration: number = 5000
|
|
): void {
|
|
toast.push({
|
|
component: {
|
|
src: Toast,
|
|
props: {
|
|
message,
|
|
error,
|
|
actions,
|
|
errorMessage,
|
|
duration
|
|
},
|
|
sendIdTo: 'toastId'
|
|
},
|
|
dismissable: false,
|
|
initial: 0,
|
|
theme: {
|
|
'--toastPadding': '0',
|
|
'--toastMsgPadding': '0'
|
|
}
|
|
})
|
|
}
|