import { defineStore } from 'pinia';
import piniaPersistConfig from '@/stores/helper/persist';

export const useUserStore = defineStore({
  id: 'admin-user',
  state: () => ({
    token: '',
    userInfo: { name: 'Admin' },
  }),
  getters: {},
  actions: {
    // Set Token
    setToken(token) {
      this.token = token;
    },
    // Set setUserInfo
    setUserInfo(userInfo) {
      this.userInfo = userInfo;
    },
  },
  persist: piniaPersistConfig('admin-user'),
});
