/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @cspell/spellchecker */
import { lens } from '@dhmk/zustand-lens';
import { PathType } from '~/shared/constants/paths';

export interface UtilEvents {
  redirectPath?: PathType;
  notiBarMessage?: string;
  snackBarMessage?: string;
}
export interface UtilEventState extends UtilEvents {
  setRedirectPath: (redirectPath: PathType) => void;
  setNotiBarMessage: (notiBarMessage: string) => void;
  setSnackBarMessage: (snackBarMessage: string) => void;
}
export const createUtilEventSlice = lens<UtilEventState>((set, get) => ({
  setRedirectPath: (redirectPath) => {
    set((state: UtilEventState) => {
      return {
        ...state,
        redirectPath,
      };
    });
  },
  setNotiBarMessage: (notiBarMessage) => {
    set((state: UtilEventState) => {
      return {
        ...state,
        notiBarMessage,
      };
    });
  },
  setSnackBarMessage: (snackBarMessage) => {
    set((state: UtilEventState) => {
      return {
        ...state,
        snackBarMessage,
      };
    });
  },
}));
