20 lines
629 B
TypeScript
20 lines
629 B
TypeScript
|
|
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);
|
||
|
|
},
|
||
|
|
};
|