import { Toaster } from "@/components/ui/toaster";
import { Toaster as Sonner } from "@/components/ui/sonner";
import { TooltipProvider } from "@/components/ui/tooltip";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { BrowserRouter, Routes, Route } from "react-router-dom";
import { ScrollToTop } from "./components/ScrollToTop";
import Index from "./pages/Index";
import Actualites from "./pages/Actualites";
import Catalogue from "./pages/Catalogue";
import Catalogue2Pages from "./pages/Catalogue2Pages";
import CatalogueDynamique from "./pages/CatalogueDynamique";
import Internet from "./pages/Internet";
import Television from "./pages/Television";
import Telephone from "./pages/Telephone";
import Support from "./pages/Support";
import Business from "./pages/business/Business";
import BusinessTelephony from "./pages/business/BusinessTelephony";
import BusinessMultilogement from "./pages/business/BusinessMultilogement";
import BusinessServicesGeres from "./pages/business/BusinessServicesGeres";
import BusinessInternet from "./pages/business/BusinessInternet";
import BusinessSdWan from "./pages/business/BusinessSdWan";
import BusinessSip from "./pages/business/BusinessSip";
import BusinessCloud from "./pages/business/BusinessCloud";
import BusinessVpn from "./pages/business/BusinessVpn";
import BusinessSecurite from "./pages/business/BusinessSecurite";
import BusinessAmplificationCellulaire from "./pages/business/BusinessAmplificationCellulaire";
import BusinessVirtualisation from "./pages/business/BusinessVirtualisation";
import BusinessReseauInterSites from "./pages/business/BusinessReseauInterSites";
import BusinessWifi from "./pages/business/BusinessWifi";
import BusinessCablage from "./pages/business/BusinessCablage";
import BusinessMicrosoft365 from "./pages/business/BusinessMicrosoft365";
import ContratBLB from "./pages/ContratBLB";
import PubliciteLettre from "./pages/PubliciteLettre";
import PublicitePrint from "./pages/PublicitePrint";
import BrandGuidelines from "./pages/BrandGuidelines";
import Accessibilite from "./pages/Accessibilite";
import PolitiqueConfidentialite from "./pages/PolitiqueConfidentialite";
import NotFound from "./pages/NotFound";
import AdminImport from "./pages/AdminImport";
import AdminLogin from "./pages/AdminLogin";
import { ProtectedAdminRoute } from "./components/ProtectedAdminRoute";

const queryClient = new QueryClient();

const App = () => (
  <QueryClientProvider client={queryClient}>
    <TooltipProvider>
      <Toaster />
      <Sonner />
      <BrowserRouter>
        <ScrollToTop />
        <Routes>
          <Route path="/" element={<Index />} />
          <Route path="/actualites" element={<Actualites />} />
          <Route path="/catalogue" element={<Catalogue />} />
          <Route path="/catalogue-2" element={<Catalogue2Pages />} />
          <Route path="/catalogue-3" element={<CatalogueDynamique />} />
          <Route path="/internet" element={<Internet />} />
          <Route path="/television" element={<Television />} />
          <Route path="/telephone" element={<Telephone />} />
          <Route path="/support" element={<Support />} />
          <Route path="/business" element={<Business />} />
          <Route path="/business/telephonie" element={<BusinessTelephony />} />
          <Route path="/business/multilogement" element={<BusinessMultilogement />} />
          <Route path="/business/services-geres" element={<BusinessServicesGeres />} />
          <Route path="/business/internet" element={<BusinessInternet />} />
          <Route path="/business/sd-wan" element={<BusinessSdWan />} />
          <Route path="/business/sip" element={<BusinessSip />} />
          <Route path="/business/cloud" element={<BusinessCloud />} />
          <Route path="/business/vpn" element={<BusinessVpn />} />
          <Route path="/business/securite" element={<BusinessSecurite />} />
          <Route path="/business/amplification-cellulaire" element={<BusinessAmplificationCellulaire />} />
          <Route path="/business/virtualisation" element={<BusinessVirtualisation />} />
          <Route path="/business/reseau-inter-sites" element={<BusinessReseauInterSites />} />
          <Route path="/business/wifi" element={<BusinessWifi />} />
          <Route path="/business/cablage" element={<BusinessCablage />} />
          <Route path="/business/microsoft-365" element={<BusinessMicrosoft365 />} />
          <Route path="/contrat-blb" element={<ContratBLB />} />
          <Route path="/publicite" element={<PubliciteLettre />} />
          <Route path="/publicite-print" element={<PublicitePrint />} />
          <Route path="/brand-guidelines" element={<BrandGuidelines />} />
          <Route path="/admin/login" element={<AdminLogin />} />
          <Route path="/admin/import" element={<ProtectedAdminRoute><AdminImport /></ProtectedAdminRoute>} />
          <Route path="/accessibilite" element={<Accessibilite />} />
          <Route path="/politique-de-confidentialite" element={<PolitiqueConfidentialite />} />
          {/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */}
          <Route path="*" element={<NotFound />} />
        </Routes>
      </BrowserRouter>
    </TooltipProvider>
  </QueryClientProvider>
);

export default App;
