import { useLocation, Outlet, Navigate } from "react-router-dom"; import useAuth from "./hooks/useAuth"; const ProtectedRoute = () => { const { auth }: any = useAuth(); const location = useLocation(); return ( auth?.isLoggedIn ? : ); } export default ProtectedRoute;