import type { RouteRecordRaw } from 'vue-router';

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    component: () => import('layouts/MainLayout.vue'),
    children: [
      {
        path: '',
        component: () => import('pages/LoginPage.vue'),
      },
      {
        path: '/login',
        component: () => import('pages/LoginPage.vue'),
      },
      {
        path: '/members',
        component: () => import('pages/MembersTable.vue'),
        meta: { requiresAuth: true, requiresAdmin: true },
      },
      {
        path: '/settings',
        component: () => import('pages/SettingsPage.vue'),
        meta: { requiresAuth: true, requiresAdmin: true },
      },
      {
        path: '/usersSettings',
        component: () => import('pages/UserSettings.vue'),
        meta: { requiresAuth: true, requiresAdmin: true },
      },
    ],
  },

  // Always leave this as last one,
  // but you can also remove it
  {
    path: '/:catchAll(.*)*',
    component: () => import('pages/ErrorNotFound.vue'),
  },
];

export default routes;
