import { Navigate, Outlet } from 'react-router-dom';
import useAuth from '../hooks/useAuth';

function PrivateRoute() {
  let auth = useAuth();
  
  return auth?.user?.token ? <Outlet /> : <Navigate to="/login" />;
}

export default PrivateRoute;
