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 ( ) } 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 })} /> ))}
) }