This commit is contained in:
2025-12-21 20:40:32 +01:00
commit c7f669fc11
54 changed files with 7575 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
import React from 'react';
import { Navigate } from 'react-router-dom';
import { useAuth } from '../context/AuthContext';
export const ProtectedRoute: React.FC<React.PropsWithChildren> = ({ children }) => {
const { user, loading } = useAuth();
if (loading) {
return <div className="min-h-screen flex items-center justify-center bg-gray-50 text-primary">Betöltés...</div>;
}
if (!user) {
return <Navigate to="/auth/login" replace />;
}
return <>{children}</>;
};