import {createApp} from 'vue'
import {createRouter, createWebHistory} from 'vue-router'
import App from '@/App.vue'
import {Layout, Menu} from 'ant-design-vue'
import 'ant-design-vue/dist/reset.css'

createApp(App)
  .use(Layout)
  .use(Menu)
  .use(createRouter({
    history: createWebHistory(),
    routes: [
      {path: '/', redirect: 'home'},
      {
        name: 'home',
        path: '/home',
        component: () => import('@/views/Home.vue'),
      },
      {
        name: 'management',
        path: '/management',
        component: () => import('@/views/management/Index.vue'),
        redirect: '/management/overview',
        children: [
          {
            name: 'overview',
            path: 'overview',
            component: () => import('@/views/management/Overview.vue'),
          },
          {
            name: 'setting',
            path: 'setting',
            component: () => import('@/views/management/Setting.vue'),
          },
        ],
      },
    ],
  }))
  .mount('#app')
