import { useId, type FormEvent } from 'react' import type { FieldDef } from '../../api/engines/registry' import type { RoleDraft, Schema } from '../../api/engines/roles' function Field({ field, value, onChange }: { field: FieldDef; value: string | boolean; onChange: (v: string | boolean) => void }) { const helpId = useId() const help = field.help ? ( {field.help} ) : null const describedBy = field.help ? helpId : undefined if (field.type === 'bool') { return ( // "check" lays the box beside its text; a plain label in a form stacks them. ) } if (field.type === 'secret') { const hint = 'Write-only. Leave blank to keep the stored value.' return (