import { Navigate } from 'react-router-dom';
import UnauthenticatedResult from '../../components/results/401';
import { useAuth } from '../../hooks/useAuth';

const UnauthenticatedPage = () => {
  const { isAuthenticated } = useAuth();

  if (isAuthenticated) {
    return <Navigate to="/invoice" />;
  }

  return <UnauthenticatedResult />;
};

export default UnauthenticatedPage;
