Lib: Allow setting timeout in toast helpers

This commit is contained in:
2025-03-15 00:19:00 +01:00
parent 3a9b4d6834
commit e35d56c81c

View File

@ -1,28 +1,28 @@
import type { ToastSettings } from "@skeletonlabs/skeleton";
export const get_info_toast = (message: string): ToastSettings => {
export const get_info_toast = (message: string, timeout: number = 2000): ToastSettings => {
return {
message,
hideDismiss: true,
timeout: 2000,
timeout,
background: "variant-filled-tertiary",
};
};
export const get_warning_toast = (message: string): ToastSettings => {
export const get_warning_toast = (message: string, timeout: number = 2000): ToastSettings => {
return {
message,
hideDismiss: true,
timeout: 2000,
timeout,
background: "variant-filled-secondary",
};
};
export const get_error_toast = (message: string): ToastSettings => {
export const get_error_toast = (message: string, timeout: number = 2000): ToastSettings => {
return {
message,
hideDismiss: true,
timeout: 2000,
timeout,
background: "variant-filled-primary",
};
};