routing
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import { Suspense } from "react";
|
||||
import { HomePage } from "@/pages/home.page";
|
||||
import { SecondaryPage } from "@/pages/secondary.page";
|
||||
import { ProtectedRoute } from "./helper/protected.route";
|
||||
import { Routes as ReactRoutes, Route } from "react-router-dom";
|
||||
|
||||
export const Routing = () => {
|
||||
return (
|
||||
<Suspense
|
||||
fallback={
|
||||
<div className="flex items-center justify-center min-h-screen">
|
||||
Загрузка...
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<ReactRoutes>
|
||||
<Route path="/home" element={<HomePage />} />
|
||||
|
||||
<Route>
|
||||
<Route
|
||||
path="/secondary"
|
||||
element={
|
||||
<ProtectedRoute>
|
||||
<SecondaryPage />
|
||||
</ProtectedRoute>
|
||||
}
|
||||
/>
|
||||
</Route>
|
||||
</ReactRoutes>
|
||||
</Suspense>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user