"use client"; import * as React from "react"; import { Input } from "../../ui/input"; import { Label } from "../../ui/label"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "../../ui/select"; import { useMessages } from "../../context"; import { StatementAuditSelect, type StatementAuditOption, } from "../StatementAuditSelect"; import { StatementField } from "../StatementField"; import type { StatementFormController } from "../formController"; import { DATE_INPUT, FIELD_GRID, FULL_ROW } from "./layout"; /** Which audit the statement declares, and the choice the page offers. */ export interface StatementAuditChoice { /** A job id, or `LATEST_AUDIT`. */ value: string; onChange: (value: string) => void; options: StatementAuditOption[]; /** * The picker moved and the preview still shows the audit saved before: said * under the picker until the next save. */ unsaved: boolean; } /** What the statement claims: the level, the day it was drawn up, and the * audit its outcome is read from. */ export function ConformanceSection({ controller, audit, }: { controller: StatementFormController; audit: StatementAuditChoice; }) { const messages = useMessages(); const statementDict = messages.statement; const formDict = statementDict.form; const fields = formDict.fields; const { form, patch, fieldError, readOnly, today } = controller; return (
{audit.unsaved ? formDict.auditPicker.unsaved : null}