import { Navigate, useLocation } from 'react-router-dom'; import { useAuth } from '@/contexts/AuthContext'; interface ProtectedRouteProps { children: React.ReactNode; } export default function ProtectedRoute({ children }: ProtectedRouteProps) { const { isAuthenticated, isLoading } = useAuth(); const location = useLocation(); console.log('ProtectedRoute check:', { isAuthenticated, isLoading, path: location.pathname }); if (isLoading) { // Show a loading spinner while authentication state is being determined return (