/** * * FormModal * */ import React from 'react'; import { useIntl } from 'react-intl'; import { Stack, Grid, GridItem, ModalLayout, ModalHeader, ModalFooter, ModalBody, Button, Breadcrumbs, Crumb, } from '@strapi/parts'; import PropTypes from 'prop-types'; import Input from './Input'; // import { getTrad } from '../../../utils'; const FormModal = ({ headerBreadcrumbs, layout, isOpen, onToggle, providerToEditName }) => { const { formatMessage } = useIntl(); if (!isOpen) { return null; } return ( {headerBreadcrumbs.map(crumb => ( {crumb} ))}
e.preventDefault()}> {layout.form.map(row => { return row.map(input => { return ( {/* "TEXT CUSTOM" }} error={formErrors?.[input.name]} onChange={handleChange} value={modifiedData[input.name]} /> */} ); }); })}
{formatMessage({ id: 'app.components.Button.cancel', defaultMessage: 'Cancel' })} } endActions={ <> } />
); }; FormModal.defaultProps = { providerToEditName: null, }; FormModal.propTypes = { headerBreadcrumbs: PropTypes.arrayOf(PropTypes.string).isRequired, layout: PropTypes.shape({ form: PropTypes.arrayOf(PropTypes.array), schema: PropTypes.object, }).isRequired, isOpen: PropTypes.bool.isRequired, onToggle: PropTypes.func.isRequired, providerToEditName: PropTypes.string, }; export default FormModal;