"use client"; import * as React from "react"; import { Input } from "../../ui/input"; import { useMessages } from "../../context"; import { StatementField } from "../StatementField"; import type { StatementFormController } from "../formController"; import { FIELD_GRID } from "./layout"; /** Where a visitor writes to, and who answers for accessibility. */ export function ContactSection({ controller, }: { controller: StatementFormController; }) { const messages = useMessages(); const fields = messages.statement.form.fields; const { form, patch, fieldError, readOnly } = controller; return (
) => patch("contactEmail", e.target.value) } placeholder={fields.contactEmailPlaceholder} disabled={readOnly} /> {/* Asked of everyone — a private company with a named contact should still publish one — but required of a public administration alone, which the AgID model expects to name the person responsible for accessibility. `required` drives both the asterisk and `aria-required`, so it has to follow the entity type rather than be hardcoded. */} ) => patch("firstName", e.target.value) } placeholder={fields.firstNamePlaceholder} disabled={readOnly} /> ) => patch("lastName", e.target.value) } placeholder={fields.lastNamePlaceholder} disabled={readOnly} />
); }