const renderField = (field) => {
switch (field.type) {
case 'text':
case 'email':
return <input {...field} />;
case 'select':
return (
<select>
{
field.options.map(option =>
<option key={option.id} >{option.data}</option>)
}
</select>
);
default:
console.error('Unsupported type');
return null;
}
};