import { Navigate, Outlet, useLocation } from 'react-router-dom'; import { ScreenLoader } from '@/components/loaders'; import { useAuthContext } from './useAuthContext'; const RequireAuth = () => { const { auth, loading } = useAuthContext(); const location = useLocation(); // console.log('RequireAuth render: loading =', loading, ' auth =', auth); if (loading) { return ; } return auth ? : ; }; export { RequireAuth };