import { SettingState } from '@/stores/interface'
import { LayoutTypeEnum } from '@/enums/LayoutTypeEnum'
import { DEFAULT_SETTING } from '@/constants'
export const useSettingStore = defineStore('eco-setting', {
  state: (): SettingState => ({
    layout: LayoutTypeEnum.CLASSIC, // mix | classic | transverse
    breadcrumb: true,
    breadcrumbIcon: true,
    footer: true,
    isDark: false,
    primary: DEFAULT_SETTING.PRIMARY,
    // 侧边栏反转
    asideInverted: false,
    // 头部反转
    headerInverted: false,
    showTaps: DEFAULT_SETTING.SHOW_TAPS,
    tagsViewIcon: DEFAULT_SETTING.TAPS_VIEW_ICON
  }),
  getters: {},
  actions: {
    setGlobalState(...args: ObjToKeyValArray<SettingState>) {
      this.$patch({ [args[0]]: args[1] })
    }
  },
  persist: true
})
