feat: create stucture
ci-front / build (push) Successful in 2m21s

This commit is contained in:
2026-04-03 19:56:41 +03:00
parent a8b6265a40
commit add00401de
12 changed files with 2655 additions and 430 deletions
@@ -0,0 +1,12 @@
import { useAuthStore } from "@/store/auth/auth.store";
import { Navigate } from "react-router-dom";
export const ProtectedRoute = ({ children }: { children: React.ReactNode }) => {
const { isAuthenticated } = useAuthStore();
if (!isAuthenticated) {
return <Navigate to="/auth" replace />;
}
return <>{children}</>;
};
@@ -0,0 +1,21 @@
import { Suspense } from "react";
import { Routes as ReactRoutes, Route, Navigate } from "react-router-dom";
import { HomePage } from "@/pages/home.page";
export const Routing = () => {
return (
<Suspense
fallback={
<div className="flex items-center justify-center min-h-screen">
Загрузка...
</div>
}
>
<ReactRoutes>
<Route path="/" element={<HomePage />} />
<Route path="*" element={<Navigate to="/" replace />} />
</ReactRoutes>
</Suspense>
);
};