import ScheduleIndexPage from 'pages/schedule/ScheduleIndexPage.vue';
import ChecklistPageVue from 'pages/ChecklistPage.vue';
import LoginPageVue from 'pages/LoginPage.vue';
import ReferencePageVue from 'src/pages/reference/ReferencePage.vue';
import ReferenceIndexPageVue from 'src/pages/reference/ReferenceIndexPage.vue';
import ReferenceItemPageVue from 'src/pages/reference/ReferenceItemPage.vue';
import MainLayoutVue from 'src/layouts/MainLayout.vue';
import BoatPageVue from 'src/pages/BoatPage.vue';
import CertificationPageVue from 'src/pages/CertificationPage.vue';
import IndexPageVue from 'src/pages/IndexPage.vue';
import ProfilePageVue from 'src/pages/ProfilePage.vue';
import TaskPageVue from 'src/pages/TaskPage.vue';
import { RouteRecordRaw } from 'vue-router';
import SchedulePageView from 'pages/schedule/SchedulePageView.vue';
import BoatReservationPageVue from 'src/pages/schedule/BoatReservationPage.vue';
import BoatScheduleViewVue from 'src/pages/schedule/BoatScheduleView.vue';

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    component: MainLayoutVue,
    // If we get so big we need lazy loading, we can use imports again
    // component: () => import('layouts/MainLayout.vue'),
    children: [
      {
        path: '',
        // If we get so big we need lazy loading, we can use imports again
        // component: () => import('pages/IndexPage.vue'),
        component: IndexPageVue,
        name: 'index',
      },
      {
        path: '/boat',
        component: BoatPageVue,
        name: 'boat',
      },
      {
        path: '/schedule',
        component: SchedulePageView,
        name: 'schedule',
        children: [
          {
            path: '',
            component: ScheduleIndexPage,
            name: 'schedule-index',
          },
          {
            path: 'book',
            component: BoatReservationPageVue,
            name: 'reserve-boat',
          },
          {
            path: 'view',
            component: BoatScheduleViewVue,
            name: 'boat-schedule',
          },
        ],
      },
      {
        path: '/certification',
        component: CertificationPageVue,
        name: 'certification',
      },
      {
        path: '/task',
        component: TaskPageVue,
        name: 'task',
      },
      {
        path: '/checklist',
        component: ChecklistPageVue,
        name: 'checklist',
      },
      {
        path: '/profile',
        component: ProfilePageVue,
        name: 'profile',
      },
      {
        path: '/reference',
        component: ReferencePageVue,
        name: 'reference',
        children: [
          {
            path: '',
            component: ReferenceIndexPageVue,
            name: 'reference-index',
          },
          {
            path: '/reference/:id/view',
            component: ReferenceItemPageVue,
          },
        ],
      },
    ],
  },
  {
    path: '/admin',
    component: () => import('layouts/AdminLayout.vue'),
    children: [
      {
        path: '/user',
        component: () => import('pages/admin/UserAdminPage.vue'),
        name: 'useradmin',
      },
      {
        path: '/boat',
        component: () => import('pages/admin/BoatAdminPage.vue'),
        name: 'boatadmin',
      },
    ],
  },
  {
    path: '/login',
    component: LoginPageVue,
    name: 'login',
    meta: {
      publicRoute: true,
    },
  },
  {
    path: '/terms-of-service',
    component: () => import('pages/TermsOfServicePage.vue'),
    name: 'tospage',
    meta: {
      publicRoute: true,
    },
  },
  {
    path: '/privacy-policy',
    component: () => import('pages/PrivacyPolicyPage.vue'),
    name: 'privacy-policy',
    meta: {
      publicRoute: true,
    },
  },
  // {
  //   path: '/register',
  //   component: () => import('pages/RegisterPage.vue'),
  //   name: 'register'
  //   meta: {
  //    accountRoute: true,
  //   }
  // },
  // Always leave this as last one,
  // but you can also remove it
  {
    path: '/:catchAll(.*)*',
    component: () => import('pages/ErrorNotFound.vue'),
  },
];

export default routes;
