"use client"; import type { FieldConfig, SelectOption } from "@/types/form"; import type { UseFormRegister, FieldValues, FieldErrors } from "react-hook-form"; interface FieldRendererProps { field: FieldConfig; register: UseFormRegister; errors: FieldErrors; /** For readonly display fields, the value to render. */ readonlyValue?: unknown; /** * Options resolved at runtime (from /api/data). When `field.optionGroupId` * is set, look up options here first; fall back to the field's hard-coded * `options` array if absent. */ resolvedOptions?: SelectOption[]; } /** * Renders a single field appropriate to its `type`. All inputs share a common * accessibility scaffold: a real