/** * Protected Route - PRODUCTION READY * Uses shared AuthContext - no independent session checks */ import { Navigate, useLocation } from 'react-router-dom'; import { useAuth } from '../contexts/AuthContext'; interface Props { children: React.ReactNode; requireAdmin?: boolean; } export default function ProtectedRoute({ children, requireAdmin = false }: Props) { const location = useLocation(); const { isAuthenticated, loading, user } = useAuth(); // Show loading while AuthContext is checking session if (loading) { return (