import { useAuth } from 'src/contexts/JWTContext';
import { type ApprovalStep } from 'src/types/vacations';

export const useCanReviewRequest = (step: ApprovalStep) => {
  const { user: currentUser } = useAuth();

  const canReview = step.potentialApprovers.some(
    approver => approver.id === currentUser?.id,
  );

  return canReview;
};
