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

// Routes = miroir exact du site React (apps/website src/App.tsx). Lazy-loaded.
const routes: RouteRecordRaw[] = [
  { path: "/", component: () => import("@/pages/Index.vue") },
  { path: "/actualites", component: () => import("@/pages/Actualites.vue") },
  { path: "/catalogue", component: () => import("@/pages/Catalogue.vue") },
  { path: "/catalogue-2", component: () => import("@/pages/Catalogue2Pages.vue") },
  { path: "/catalogue-3", component: () => import("@/pages/CatalogueDynamique.vue") },
  { path: "/internet", component: () => import("@/pages/Internet.vue") },
  { path: "/television", component: () => import("@/pages/Television.vue") },
  { path: "/telephone", component: () => import("@/pages/Telephone.vue") },
  { path: "/support", component: () => import("@/pages/Support.vue") },
  { path: "/business", component: () => import("@/pages/business/Business.vue") },
  { path: "/business/telephonie", component: () => import("@/pages/business/BusinessTelephony.vue") },
  { path: "/business/multilogement", component: () => import("@/pages/business/BusinessMultilogement.vue") },
  { path: "/business/services-geres", component: () => import("@/pages/business/BusinessServicesGeres.vue") },
  { path: "/business/internet", component: () => import("@/pages/business/BusinessInternet.vue") },
  { path: "/business/sd-wan", component: () => import("@/pages/business/BusinessSdWan.vue") },
  { path: "/business/sip", component: () => import("@/pages/business/BusinessSip.vue") },
  { path: "/business/cloud", component: () => import("@/pages/business/BusinessCloud.vue") },
  { path: "/business/vpn", component: () => import("@/pages/business/BusinessVpn.vue") },
  { path: "/business/securite", component: () => import("@/pages/business/BusinessSecurite.vue") },
  { path: "/business/amplification-cellulaire", component: () => import("@/pages/business/BusinessAmplificationCellulaire.vue") },
  { path: "/business/virtualisation", component: () => import("@/pages/business/BusinessVirtualisation.vue") },
  { path: "/business/reseau-inter-sites", component: () => import("@/pages/business/BusinessReseauInterSites.vue") },
  { path: "/business/wifi", component: () => import("@/pages/business/BusinessWifi.vue") },
  { path: "/business/cablage", component: () => import("@/pages/business/BusinessCablage.vue") },
  { path: "/business/microsoft-365", component: () => import("@/pages/business/BusinessMicrosoft365.vue") },
  { path: "/contrat-blb", component: () => import("@/pages/ContratBLB.vue") },
  { path: "/publicite", component: () => import("@/pages/PubliciteLettre.vue") },
  { path: "/publicite-print", component: () => import("@/pages/PublicitePrint.vue") },
  { path: "/brand-guidelines", component: () => import("@/pages/BrandGuidelines.vue") },
  { path: "/admin/login", component: () => import("@/pages/AdminLogin.vue") },
  { path: "/admin/import", component: () => import("@/pages/AdminImport.vue") },
  { path: "/accessibilite", component: () => import("@/pages/Accessibilite.vue") },
  { path: "/politique-de-confidentialite", component: () => import("@/pages/PolitiqueConfidentialite.vue") },
  { path: "/:pathMatch(.*)*", component: () => import("@/pages/NotFound.vue") },
];

const router = createRouter({
  history: createWebHistory("/next/"),
  routes,
  // Équivalent du <ScrollToTop /> React : remonte en haut à chaque navigation.
  scrollBehavior() {
    return { top: 0 };
  },
});

export default router;
