// The blocker a patient meets when a practice has booked them and nothing has been agreed yet. // // It is FRAME FURNITURE - it belongs in the banner slot on every screen, not on one page. The failure // this corrects is that consent lived as a task: something in a list, on a page nobody has a reason to // open, while an appointment the practice cannot lawfully honour sat in the diary. // // Presentation only. It takes the three answers and gives back which document was opened; it does not // know how they are stored, and it does not decide whether the practice may treat anybody - the status // bundle answers that server-side. The names come from `config/consentInstruments.ts`, never from here. // // The drawn amber panel carries its own two inks - #5c3d0b for regular text and #8a5a10 for links. // The plugin has a token for neither, so this uses the warm ink scale and the Tailwind amber it does // have. Adding those two as tokens is a design-system change and belongs with the styling work. import { Check, TriangleAlert, X } from 'lucide-react'; import { ConsentInstrumentId } from '../../config/consentInstruments'; import { ORG_AGREEMENT_ORDER, OrgAgreementState, hasOutstandingAgreement, orgAgreementName, } from './orgAgreements'; interface OutstandingAgreementsNoticeProps { /** The practice's name, as the patient knows it. */ organizationName: string; agreements: readonly OrgAgreementState[]; onOpenAgreement: (instrument: ConsentInstrumentId) => void; } const OutstandingAgreementsNotice = ({ organizationName, agreements, onOpenAgreement, }: OutstandingAgreementsNoticeProps) => { // It exists only while something is owed. Once every document has an answer the notice is gone // entirely - not collapsed, not a tick, gone. if (!hasOutstandingAgreement(agreements)) { return null; } const answerFor = (instrument: ConsentInstrumentId) => agreements.find((agreement) => agreement.instrument === instrument)?.answer ?? 'outstanding'; return (
{/* The icon sits beside the sentence and NOT above the list: the list is indented under the text, so an eye reads one column of words rather than stepping around a glyph. */}
); }; export default OutstandingAgreementsNotice;