import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '../../../../components/ui/dialog.tsx'; import { Input } from '../../../../components/ui/input.tsx'; import { useActivationContinuation } from '../../../../hooks/useActivationContinuation'; interface Props { open: boolean; onOpenChange(open: boolean): void; patientId: string; patientName?: string; onActivated(isCurrent: () => boolean): void; } export default function GivePatientALoginDialog({ open, onOpenChange, patientId, patientName, onActivated }: Props) { const flow = useActivationContinuation({ open, childPatientId: patientId, onActivated }); const subject = patientName?.trim() || 'this patient'; const changeOpen = (next: boolean) => { if (!next && !flow.retire()) return; onOpenChange(next); }; return ( Give {subject} a login This account can access their existing record and history. No duplicate record is created.
flow.setEmail(event.target.value)} disabled={flow.submitting} placeholder="patient@example.com" /> {flow.email.trim() && !flow.emailValid &&

Enter a valid email address.

}

Only do this once you are sure this is the right person — you are vouching that they are.

{flow.notice &&

{flow.notice}

} {flow.answer?.caseReference &&

Reference: {flow.answer.caseReference}

} {flow.error &&

{flow.error}

}
{flow.canStartNew && }
); }