Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import {
- AboutPage,
- AntiCorruption,
- ContactsPage,
- CooperationClientsPage,
- CooperationInvestorsPage,
- CooperationPage,
- CooperationProcurementPage,
- EmployeePage,
- FaqPage,
- HomePage,
- HotlinePage,
- NewsArticlePage,
- NewsPage,
- NotFoundPage,
- ServicesCalculatorsPage,
- ServicesPage,
- ServicesTariffsPage,
- TrackingPage,
- TransRussia,
- VacanciesPage,
- } from "@/pages";
- import { Suspense } from "react";
- import { Navigate, RouteObject } from "react-router-dom";
- import { AppLayout } from "../layouts";
- const langFromLocalStorage = localStorage.getItem("i18nextLng");
- const validateLang = ["ru", "kz", "en", "zh"].includes(
- langFromLocalStorage || "",
- );
- export const routes: RouteObject[] = [
- {
- element: <AppLayout />,
- children: [
- {
- path: "/",
- element: (
- <Navigate
- to={`${validateLang ? `/${langFromLocalStorage}` : "/kz"}`}
- />
- ),
- },
- {
- path: ":lang",
- children: [
- {
- path: "",
- element: <HomePage />,
- },
- {
- path: "faq",
- element: <FaqPage />,
- },
- {
- path: "news",
- element: <NewsPage />,
- },
- {
- path: "news/:articleId",
- element: <NewsArticlePage />,
- },
- {
- path: "hotline",
- element: <HotlinePage />,
- },
- {
- path: "vacancies",
- element: <VacanciesPage />,
- },
- {
- path: "about",
- element: <AboutPage />,
- },
- {
- path: "about/employee/:pageId/:employeeId",
- element: <EmployeePage />,
- },
- {
- path: "tracking",
- element: <TrackingPage />,
- },
- {
- path: "contacts",
- element: (
- <Suspense fallback={<div className="h-[600px]"></div>}>
- <ContactsPage />
- </Suspense>
- ),
- },
- {
- path: "services",
- element: <ServicesPage />,
- },
- {
- path: "services/calculators",
- element: <ServicesCalculatorsPage />,
- },
- {
- path: "services/tariffs",
- element: <ServicesTariffsPage />,
- },
- {
- path: "cooperation",
- element: <CooperationPage />,
- },
- {
- path: "cooperation/clients",
- element: <CooperationClientsPage />,
- },
- {
- path: "cooperation/investors",
- element: <CooperationInvestorsPage />,
- },
- {
- path: "cooperation/procurement",
- element: <CooperationProcurementPage />,
- },
- {
- path: "anti-corruption",
- element: <AntiCorruption />,
- },
- {
- path: "TransRussia",
- element: (
- <Suspense fallback={<div className="h-[600px]"></div>}>
- <TransRussia />
- </Suspense>
- ),
- },
- ],
- },
- {
- path: "*",
- element: <NotFoundPage />,
- },
- ],
- },
- ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement