"use client"; import * as React from "react"; import { Input } from "../../ui/input"; import { useMessages } from "../../context"; import { StatementField, StatementYesNo } from "../StatementField"; import type { StatementFormController } from "../formController"; import { DATE_INPUT, FIELD_GRID } from "./layout"; /** The site the statement is about: its address, what it runs on, when it * went live, and whether it was tested with users. */ export function SiteSection({ controller, }: { controller: StatementFormController; }) { const messages = useMessages(); const fields = messages.statement.form.fields; const { form, patch, fieldError, readOnly, today } = controller; return (
{/* Read-only, not disabled: it is the site's own address, which the customer may want to read through or copy, and a disabled field is skipped by the keyboard and by most screen readers. Generation reads the same column, so there is nothing to type here. */} ) => patch("siteCMS", e.target.value) } placeholder={fields.siteCMSPlaceholder} disabled={readOnly} /> ) => patch("sitePublicationDate", e.target.value) } className={DATE_INPUT} disabled={readOnly} />
patch("usabilityTestsPerformed", v)} yesLabel={fields.answerYes} noLabel={fields.answerNo} disabled={readOnly} />
); }