{
dispatch({
type: 'ON_CHANGE',
keys: name.split('.'),
value,
});
}}
layout={get(groupLayoutsData, name, {})}
/>
);
}
return (
{fieldsRow.map(({ name }) => {
const attribute = get(
layout,
['schema', 'attributes', name],
{}
);
const { model, collection } = attribute;
const isMedia =
get(attribute, 'plugin', '') === 'upload' &&
(model || collection) === 'file';
const multiple = collection == 'file';
const metadata = get(
layout,
['metadata', name, 'edit'],
{}
);
const type = isMedia
? 'file'
: get(attribute, 'type', null);
const inputStyle =
type === 'text' ? { height: '196px' } : {};
const validations = omit(attribute, [
'type',
'model',
'via',
'collection',
'default',
'plugin',
'enum',
]);
const value = get(modifiedData, name);
const { description, visible } = metadata;
// Remove the updatedAt & createdAt fields
if (visible === false) {
return null;
}
return (
{
dispatch({
type: 'ON_CHANGE',
keys: name.split('.'),
value,
});
}}
selectOptions={get(attribute, 'enum', [])}
type={type}
validations={validations}
value={value}
/>
);
})}
);
})}