<script setup lang="ts">
import { GlobalFeedback } from '@/components';
import { useVersionCheckQuery } from '@/composables';
import { useSettingStore } from '@/stores';
import { VueQueryDevtools } from '@tanstack/vue-query-devtools';
import { dateZhCN, NConfigProvider, NDialogProvider, NLoadingBarProvider, NMessageProvider, NNotificationProvider, zhCN } from 'naive-ui';
import { storeToRefs } from 'pinia';

const settingStore = useSettingStore();
const { themeMode, offlineDev } = storeToRefs(settingStore);

// 允许通过控制台启用离线开发模式 (登录页适用)
window.$offlineDev = offlineDev;

useVersionCheckQuery();
</script>

<template>
  <NConfigProvider :locale="zhCN" :date-locale="dateZhCN" :theme="themeMode">
    <NDialogProvider>
      <NLoadingBarProvider>
        <NMessageProvider>
          <NNotificationProvider>
            <GlobalFeedback />
            <RouterView />
            <VueQueryDevtools />
          </NNotificationProvider>
        </NMessageProvider>
      </NLoadingBarProvider>
    </NDialogProvider>
  </NConfigProvider>
</template>

<style scoped lang="scss"></style>
