import { createRouter, createWebHistory } from "vue-router";

import HomePage from "../pages/home/index.vue";
import ProjectPage from "../pages/project/index.vue";
import SubcontractPage from "../pages/subcontract/index.vue";
import MeasurementPage from "../pages/measurement/index.vue";
import PlanPage from "../pages/plan/index.vue";
import ProgressPage from "../pages/progress/index.vue";
import ProgressBindingPage from "../pages/progress/binding.vue";
import ChangePage from "../pages/change/index.vue";
import MaterialPage from "../pages/material/index.vue";
import InspectionPage from "../pages/inspection/index.vue";
import DebugPage from "../pages/debug/index.vue";

const routes = [
  { path: "/", redirect: "/home" },
  { path: "/home", component: HomePage },
  { path: "/project", component: ProjectPage },
  { path: "/subcontract", component: SubcontractPage },
  { path: "/measurement", component: MeasurementPage },
  { path: "/plan", component: PlanPage },
  { path: "/progress", component: ProgressPage },
  { path: "/progress/binding", component: ProgressBindingPage },
  { path: "/change", component: ChangePage },
  { path: "/material", component: MaterialPage },
  { path: "/inspection", component: InspectionPage },
  { path: "/debug", component: DebugPage },
  { path: "/:pathMatch(.*)*", redirect: "/home" },
];

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

export default router;
