-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroutes.jsx
35 lines (33 loc) · 1.28 KB
/
routes.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// src/routes.js
import App from "./src/App";
import { Navigate } from "react-router-dom";
import Visualization from "./src/assets/components/Section/Sections/Visualization/Visualization";
import Statistics from "./src/assets/components/Section/Sections/Statistics/Statistics";
import Consumption from "./src/assets/components/Section/Sections/Consumption/Consumption";
import HomePage from "./src/assets/components/HomePage/HomePage";
import LanguageCheck from "./LanguageCheck";
import ErrorPage from "./src/assets/components/ErrorPage/ErrorPage";
import consumptionRoutes from "./src/assets/components/Section/Sections/Consumption/consumptionRoutes";
const routes = [
{ path: "/", element: <Navigate to="/ka" replace /> }, // Redirect to /ka
{
path: "/:language",
element: (
<LanguageCheck>
<App />
</LanguageCheck>
),
children: [
{ path: "", element: <HomePage /> }, // Render home page
{ path: "visualization", element: <Visualization /> },
{ path: "statistics", element: <Statistics /> },
{
path: "consumption",
element: <Consumption />,
children: consumptionRoutes, // Use the defined consumption routes
},
],
},
{ path: "*", element: <ErrorPage /> }, // Catch-all for errors
];
export default routes;