import { defineComponent } from 'vue';
import { ConfigProvider } from 'ant-design-vue';
import zhCN from 'ant-design-vue/locale/zh_CN';
import { RouterView } from 'vue-router';
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';
dayjs.locale('zh-cn');

/**
 * 根组件
 * 通过 ConfigProvider 注入 ant-design-vue 全局配置(语言、主题色)
 */
export default defineComponent({
  name: 'App',
  setup() {
    const theme = {
      token: {
        colorPrimary: '#1677ff',
        borderRadius: 8,
      },
    };

    return () => (
      <ConfigProvider locale={zhCN} theme={theme}>
        <RouterView />
      </ConfigProvider>
    );
  },
});
