<template>
  <a-config-provider :locale="locale">
    <router-view />
    <global-setting />
  </a-config-provider>
</template>

<script lang="ts" setup>
import { computed } from 'vue'
import { RouteLocationNormalized } from 'vue-router'
import zhCN from '@arco-design/web-vue/es/locale/lang/zh-cn'
import GlobalSetting from '@/components/global-setting/index.vue'
// import useLocale from '@/hooks/locale'

import { useUserStore } from '@/store'
import { listenerRouteChange } from './logics/mitt/routeChange'
import { downloadFile } from './utils/download'

const userStore = useUserStore()
const { setRouter } = userStore
// const { currentLocale } = useLocale()
const locale = computed(() => {
  return zhCN
})
listenerRouteChange(async (r: RouteLocationNormalized) => {
  setRouter(r)
})
</script>
