import { useLocation, Outlet, Navigate } from "react-router-dom"; import NavBar from "./components/navbar/NavBar"; import useAuth from "./hooks/useAuth"; const ProtectedRoute = () => { const auth = useAuth(); const location = useLocation(); return ((auth.loginNeeded !== undefined && !auth.loginNeeded) || auth?.isLoggedIn) ? ( <> ) : ( ); }; export default ProtectedRoute;