import { createRouter, createWebHashHistory } from 'vue-router';
import type { RouteRecordRaw } from 'vue-router';

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    name: 'Layout',
    component: () => import('../layout/index.vue'),
    redirect: '/home',
    children: [
      {
        path: '/home',
        name: 'Home',
        component: () => import('../views/home/index.vue'),
      },
      {
        path: '/quality',
        name: 'Quality',
        component: () => import('../views/quality/index.vue'),
      },
      {
        path: '/safety',
        name: 'Safety',
        component: () => import('../views/safety/index.vue'),
      },
      {
        path: '/process',
        name: 'Process',
        component: () => import('../views/process/index.vue'),
      },
    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
