import { defineStore } from 'pinia'

import config from '@/config'
import Cookies from 'js-cookie'

export const useSettingStore = defineStore('setting', {
    state: () => {
        return {
            isMobile: false,
            // animates: ADMIN.animates,
            // palettes: ADMIN.palettes,
            pageMinHeight: 0,
            menuData: [],
            activatedFirst: undefined,
            customTitles: '',
            theme: 'dark',
            lang: Cookies.get('lang') || 'tw',
            ...config,
            // ...localSetting
        }
    },
    actions: {
        setDevice(isMobile) {
            this.isMobile = isMobile
        },
        setLang(lang) {
            this.lang = lang
            Cookies.set('lang', lang)
        }
    }
})
