import React from 'react'; import { Navigate } from 'react-router-dom'; import { useAuth } from '../contexts/AuthContext'; const ProtectedRoute = ({ children, requireAuth = true }) => { const { isAuthenticated, loading } = useAuth(); if (loading) { return (