import { defineStore } from 'pinia'
export const useStore = defineStore('main', {
  state: () => ({
    viewport: undefined,
    login: undefined,
    token: undefined,
    common: undefined,
    pagetrack: {},
    settings: [],
    showmodal: undefined,
    snackbar: undefined,
    service: undefined,
    country: undefined,
    lang: 'vi',
    branch: {id: 1}
  }),
  actions: {
    commit(name, data) {
      this[name] = data   
    }
  },
  persist: {
    pick: ['token', 'login', 'lang'],
    storage: piniaPluginPersistedstate.localStorage()
  }
})