import { useAuth } from '../../contexts/AuthContext'; const ProtectedRoute = ({ children }) => { const { isAuthenticated, isLoading } = useAuth(); if (isLoading) { return (
Loading...
); } if (!isAuthenticated) { return (

Access Denied

Please log in to access this page.

); } return children; }; export default ProtectedRoute;