import type { useReferralContactRecovery } from '../../../hooks/useReferralContactRecovery'; import type { ReferralContactAttempt } from '../../../services/ReferralWorkbenchService'; import type { ReferralRequestScope } from '../../../utils/referralRequestScope'; import { Alert, AlertDescription } from '../../../components/ui/alert'; import { Button } from '../../../components/ui/button'; type Recovery = ReturnType; export const ReferralContactRecovery = ({ recovery, read, onReconciled }: { recovery: Recovery; read: (taskId: string, scope: ReferralRequestScope) => Promise; onReconciled: (contacts: ReferralContactAttempt[]) => void; }) => !recovery.held ? null : ( {recovery.confirmed ? 'This call is already in the saved history. Do not record it again.' : recovery.pending ? 'Confirming this contact…' : 'The contact could not be confirmed. Check saved contact history before recording another call.'} {recovery.failure ?

{recovery.failure}

: null} {recovery.checked && !recovery.confirmed ?

This call is not confirmed in the saved history. Recording remains unavailable. Check again later.

: null}
{recovery.confirmed ? : null}
);