import type { DenialState } from "../hooks/useClaimFlow";

interface ClaimDenialCardProps {
  denial: DenialState;
  onDismiss?: () => void;
}

export function ClaimDenialCard({ denial, onDismiss }: ClaimDenialCardProps) {
  return (
    <div className="claim-denial-card">
      <p className="claim-denial-message">{denial.message}</p>
      {denial.next_eligible_at != null && (
        <p className="claim-denial-next">
          Next eligible: {new Date(denial.next_eligible_at * 1000).toLocaleString()}
        </p>
      )}
      {onDismiss && (
        <button type="button" className="btn-secondary claim-denial-dismiss" onClick={onDismiss}>
          Dismiss
        </button>
      )}
    </div>
  );
}
