Files
paint-ui/lib/toast-utils.ts

20 lines
629 B
TypeScript
Raw Permalink Normal View History

import { useToastStore } from '@/store/toast-store';
/**
* Toast utility functions for easy access
*/
export const toast = {
success: (message: string, duration?: number) => {
useToastStore.getState().addToast(message, 'success', duration);
},
error: (message: string, duration?: number) => {
useToastStore.getState().addToast(message, 'error', duration);
},
warning: (message: string, duration?: number) => {
useToastStore.getState().addToast(message, 'warning', duration);
},
info: (message: string, duration?: number) => {
useToastStore.getState().addToast(message, 'info', duration);
},
};