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

export const routes = [
  {
    path: "/",
    name: "home",
    component: () => import("@/pages/home/index.vue"),
  },
  {
    path: "/home",
    name: "home_alias",
    component: () => import("@/pages/home/index.vue"),
  },
  {
    path: "/login",
    name: "login",
    component: () => import("@/pages/login/index.vue"),
  },
  {
    path: "/booking",
    name: "booking",
    component: () => import("@/pages/booking/index.vue"),
  },
  {
    path: "/goods",
    name: "goods",
    component: () => import("@/pages/goods/index.vue"),
  },
  {
    path: "/album",
    name: "album",
    component: () => import("@/pages/album/index.vue"),
  },
  {
    path: "/quick",
    name: "quick",
    component: () => import("@/pages/quick/index.vue"),
  },
  {
    path: "/order",
    name: "order_list",
    component: () => import("@/pages/order/order/list.vue"),
  },
  {
    path: "/order/detail",
    name: "order_detail",
    component: () => import("@/pages/order/order/detail.vue"),
  },
  {
    path: "/service/order",
    name: "service_order",
    component: () => import("@/pages/service/order/index.vue"),
  },
] satisfies RouteRecordRaw[];

export const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes,
  scrollBehavior() {
    return { top: 0 };
  },
});
