feat(docker): añadir Dockerfile para contenerizar la aplicación

This commit is contained in:
unknown
2026-06-11 16:05:10 -04:00
parent 74a67fbab2
commit 2a58693d31
70 changed files with 3826 additions and 874 deletions

21
src/auth/PrivateRoute.tsx Normal file
View File

@@ -0,0 +1,21 @@
import { Navigate, Outlet, useLocation } from 'react-router-dom';
import { useAuth } from './AuthContext';
export function PrivateRoute() {
const { isAuthenticated, isLoading } = useAuth();
const location = useLocation();
if (isLoading) {
return (
<div className="flex min-h-screen items-center justify-center bg-surface">
<div className="h-10 w-10 animate-spin rounded-full border-2 border-accent border-t-transparent" />
</div>
);
}
if (!isAuthenticated) {
return <Navigate to="/login" state={{ from: location }} replace />;
}
return <Outlet />;
}