import { RouteRecordRaw } from 'vue-router';
import LOGIN from '../modules/login/router';
import HOME from '../modules/home/router';
import AG_GRID_SELECTION from '../modules/ag-grid-selection/router';
import COMPONENTS_EXAMPLE from '../modules/components-example/router';
import PINIA_EXAMPLE from '../modules/pinia-example/router';
import STATE_MGT from '../modules/state-mgt/router';
import SOME_CSS from '../modules/some-css/router';
import ARRAY_BULK_MOVE from '../modules/array-bulk-move/router';
import WANG_EDITOR5 from '../modules/wang-editor5/router';
import CK_EDITOR5 from '../modules/ck-editor5/router';
import TEST from '../modules/test/router';

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    component: () => import('layouts/MainLayout.vue'),
    children: [
      {
        path: '',
        name: 'LaoutIndexPage',
        component: () => import('pages/IndexPage.vue'),
        redirect: '/home',
        children: [
          ...HOME,
          ...AG_GRID_SELECTION,
          ...COMPONENTS_EXAMPLE,
          ...PINIA_EXAMPLE,
          ...STATE_MGT,
          ...SOME_CSS,
          ...ARRAY_BULK_MOVE,
          ...WANG_EDITOR5,
          ...CK_EDITOR5,
          ...TEST,
        ],
      },
    ],
  },
  ...LOGIN,
  // Always leave this as last one,
  // but you can also remove it
  {
    path: '/:catchAll(.*)*',
    name: 'NOT_FOUND',
    component: () => import('pages/ErrorNotFound.vue'),
  },
];

export default routes;