import type { ReferralContactAttempt } from '../../../services/ReferralWorkbenchService'; import { formatDateTime } from '../../../utils/dateUtils'; import { EmptyState } from '../../../components/ui/empty-state'; const METHODS = { phone: 'Phone call', fax: 'Fax', 'in-system': 'Through Akashic' }; export const ReferralContactHistory = ({ contacts }: { contacts?: ReferralContactAttempt[] }) => (

Contact history

{contacts === undefined ? (

Saved contact history is unavailable. This does not mean no contact was recorded.

) : contacts.length === 0 ? ( ) : (
    {contacts.map((attempt, at) => (
  1. {METHODS[attempt.method]} ยท {formatDateTime(attempt.occurredAt)}

    {attempt.recipient ?

    Contacted: {attempt.recipient}

    : null} {attempt.spokeWith ?

    Spoke with: {attempt.spokeWith}

    : null}

    {attempt.outcome || 'Outcome not recorded.'}

    {attempt.recordedBy ? `Recorded by: ${attempt.recordedBy}` : 'Staff member not recorded.'}

  2. ))}
)}
);