import {TreeRoleMenuData} from '@models';
import {createStore} from 'zustand/vanilla';

type State = {menus: TreeRoleMenuData[]};

type Action = {
  setMenu(state: TreeRoleMenuData[]): void;
};

export const menuStore = createStore<State & Action>(function(set) {
  return {
    menus: [],
    setMenu(menus) {
      set({menus});
    },
  };
});
