Spaces:
Running
Running
File size: 419 Bytes
b034029 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | import { create } from 'zustand';
type NotificationLevel = 'success' | 'error' | 'info' | 'warning';
interface NotificationState {
showNotification: (message: string, level?: NotificationLevel) => void;
}
export const useNotificationStore = create<NotificationState>(() => ({
showNotification: (message) => {
if (typeof window !== 'undefined' && message) {
window.console.info(message);
}
}
}));
|