import { createApp } from 'vue'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import '@/styles/theme.css'

import App from './App.vue'
import router from './router'
import i18n, { applyDocumentLocale } from '@/i18n'
import { useLocaleStore } from '@/stores/locale'

const app = createApp(App)
const pinia = createPinia()

app.use(pinia)
app.use(router)
app.use(i18n)
app.use(ElementPlus)

const localeStore = useLocaleStore(pinia)
applyDocumentLocale(localeStore.locale)

app.mount('#app')
