import { create } from "zustand"; export type AlertState = { message: string; callback?: () => void; }; export type AlertActions = { setMessage: (message: string, callback?: () => void) => void; }; export type AlertStore = AlertState & AlertActions; interface AlertStoreState extends AlertStore {} const useAlertStoreHook = create((set) => ({ message: "", callback: undefined, setMessage: (message: string, callback?: () => void) => set(() => ({ message, callback })), })); export const useAlertStore = useAlertStoreHook; export const getAlertStoreState = () => useAlertStoreHook.getState();