import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'login',
      component: () => import('../views/login/login_container.vue'),
    },
    {
      path: '/dashboard',
      name: 'dashboard',
      component: () => import('../views/dashoard/dashboard.vue'),
      redirect: '',
      children: [
        {
          path: '',
          name: 'select',
          component: () => import('../views/dashoard/select.vue'),
        },
        {
          path: 'analyze',
          component: () => import('../views/dashoard/analyze.vue'),
          children: [
            {
              path: 'plan',
              component: () => import('../views/dashoard/plan.vue'),
              children: [
                {
                  path: 'calculate',
                  component: () => import('../views/dashoard/calculate.vue'),
                }
              ]
            }
          ],
        },
        {
          path: 'view',
          component: () => import('../views/dashoard/view.vue'),
          children: [
            {
              path: 'plan',
              component: () => import('../views/dashoard/plan.vue'),
              children: [
                {
                  path: 'calculate',
                  component: () => import('../views/dashoard/calculate.vue'),
                }
              ]
            }
          ],
        },
        {
          path: 'monitor',
          component: () => import('../views/dashoard/monitor.vue'),
        }
      ]
    }
  ],
})

export default router
