import { Navigate, Outlet } from 'react-router'; import { useAuth } from './useAuth'; export function ProtectedRoute() { const { user, loading } = useAuth(); if (loading) { return (
); } if (!user) { return ; } if (user.status === 'PENDING') { return ; } if (user.status === 'REJECTED' || user.status === 'DISABLED') { return ; } return ; }