frontend/stores/useToastStore.ts (view raw)
1import create from 'zustand';
2
3type State = {
4 toast?: string;
5 addToast: (message: string) => void;
6 clearToast: () => void;
7};
8
9const useToastStore = create<State>(set => ({
10 toast: null,
11 addToast: toast => set({toast}),
12 clearToast: () => set({toast: null}),
13}));
14
15export default useToastStore;