import { BasicLayout, PageView, UserLayout } from '../components/layouts'

export const routerMap = [
  {
    path: '/',
    component: BasicLayout,
    meta: { title: '' },
    redirect: '/dashboard',
    children: [
      {
        path: '/dashboard',
        name: 'dashboard',
        component: () => import(/* webpackChunkName: "dashboard" */ '../views/dashboard/Dashboard'),
        meta: { title: '概览', icon: 'dashboard' }
      },
      {
        path: '/dashboard/:id',
        name: 'dashboardDetail',
        props: true,
        hidden: true,
        component: () => import(/* webpackChunkName: "dashboard" */ '../views/dashboard/DashboardDetail'),
        meta: { title: '概览详情' }
      },
      {
        path: '/booking',
        name: 'booking',
        component: () => import(/* webpackChunkName: "booking" */ '../views/booking/Booking'),
        meta: { title: '预约', icon: 'book' },
      },
      {
        path: '/booking/create',
        name: 'bookingCreate',
        props: true,
        hidden: true,
        component: () => import(/* webpackChunkName: "booking" */ '../views/booking/BookingDetail'),
        meta: { title: '新建预约' },
      },
      {
        path: '/booking/:id/edit',
        name: 'bookingEdit',
        props: true,
        hidden: true,
        component: () => import(/* webpackChunkName: "booking" */ '../views/booking/BookingDetail'),
        meta: { title: '编辑预约' },
      },
      {
        path: '/room',
        name: 'room',
        component: () => import(/* webpackChunkName: "room" */ '../views/room/Room'),
        meta: { title: '房间', icon: 'home' }
      },
      {
        path: '/room/:id/seat',
        name: 'seat',
        props: true,
        hidden: true,
        component: () => import(/* webpackChunkName: "room" */ '../views/room/Seat'),
        meta: { title: '座位管理' }
      },
      {
        path: '/room/:id/edit',
        name: 'roomEdit',
        props: true,
        hidden: true,
        component: () => import(/* webpackChunkName: "room" */ '../views/room/RoomDetail'),
        meta: { title: '编辑房间' }
      },
      {
        path: '/account',
        name: 'account',
        component: () => import(/* webpackChunkName: "account" */ '../views/account/Account'),
        meta: { title: '用户', icon: 'team' }
      },
      {
        path: '/account/create',
        name: 'accountCreate',
        hidden: true,
        component: () => import(/* webpackChunkName: "account" */ '../views/account/AccountDetail'),
        meta: { title: '新建用户' }
      },
      {
        path: '/account/:id/edit',
        name: 'accountEdit',
        props: true,
        hidden: true,
        component: () => import(/* webpackChunkName: "account" */ '../views/account/AccountDetail'),
        meta: { title: '编辑用户' }
      },
      {
        path: '/setting',
        component: PageView,
        meta: { title: '设置', icon: 'setting' },
        children: [
          {
            path: '',
            name: 'setting',
            component: () => import(/* webpackChunkName: "setting" */ '../views/setting/GeneralSetting'),
            meta: { title: '全局设置' }
          },
          {
            path: 'user',
            name: 'settingUser',
            component: () => import(/* webpackChunkName: "setting" */ '../views/setting/UserSetting'),
            meta: { title: '用户设置' }
          },
          {
            path: 'booking',
            name: 'settingBooking',
            component: () => import(/* webpackChunkName: "setting" */ '../views/setting/BookingSetting'),
            meta: { title: '预约设置' }
          },
        ]
      },
      {
        path: '/help',
        name: 'help',
        component: () => import(/* webpackChunkName: "help" */ '../views/help/Help'),
        meta: { title: '帮助', icon: 'question-circle' }
      },
    ]
  },
  {
    path: '/user',
    component:
    UserLayout,
    redirect:
      '/user/login',
    hidden:
      true,
    children:
      [
        {
          path: 'login',
          name: 'login',
          component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
        }
      ]
  }
  ,
  {
    path: '*',
    component:
      () => import(/* webpackChunkName: "exception" */ '@/views/exception/404')
  }
]
