import { Loader2 } from "lucide-react"; import { useAuth } from "../context/AuthContext"; import { Navigate, useLocation } from "react-router-dom"; export default function ProtectedRoute({ children }) { const { authenticated, loading } = useAuth(); const location = useLocation(); if (loading) { return (

Loading...

); } if (!authenticated) { return ; } return children; }