/** * The label on the button that commits a patient import. * * - it read **"Import 1 patients"**. That is the last thing a practice clicks during * onboarding, at the moment they are deciding whether to trust us with their patient list, and a count * that cannot say "1 patient" is the kind of detail people read as *"nobody has used this."* * * EXTRACTED RATHER THAN FIXED IN PLACE, for the same reason `patientRowSummary` was: the * button sits inside a step component that no test renders, so a string built inline is a string nothing * can assert on. The bug was cheap; being unable to catch the next one is not. * * DRIVEN BY THE COUNT, never special-cased at 1. Writing `if (count === 1) return 'Import 1 patient'` * fixes the reported case and leaves the identical bug waiting at every other number - which is the * control this card asks for. */ export const importButtonLabel = (createCount: number, linkCount?: number): string => { // Nothing created and nobody matched: every row was settled or left out, so the button finishes the review. if (createCount <= 0 && linkCount === 0) { return 'Finish review'; } // Nothing to create: the review step still offers the action, and naming a count of zero would be // stranger than not naming one. This is the pre-existing wording and is deliberately unchanged. if (createCount <= 0) { return 'Import these patients'; } return `Import ${createCount} ${createCount === 1 ? 'patient' : 'patients'}`; };