import type { EmailTemplateDefinition, VariableField } from '../email/types' function FieldInput({ field, value, onChange, }: { field: VariableField value: string onChange: (v: string) => void }) { const type = field.inputType ?? 'text' return ( {field.label} onChange(e.target.value)} style={{ padding: '8px 10px', border: '1px solid #e5e7eb', borderRadius: 8 }} /> ) } export function VariablesForm({ template, data, onChange, }: { template: EmailTemplateDefinition data: Record onChange: (next: Record) => void }) { return ( Template variables {template.variables.length} fields {template.variables.map((f) => ( onChange({ ...data, [f.key]: v })} /> ))} ) }