import React from 'react'; import PropTypes from 'prop-types'; import { get } from 'lodash'; import { withRouter } from 'react-router-dom'; import { BackHeader, InputsIndex as Input, PluginHeader, LoadingIndicatorPage, } from 'strapi-helper-plugin'; import Block from '../Block'; import Container from '../Container'; import SectionTitle from '../SectionTitle'; import Separator from '../Separator'; const SettingsViewWrapper = ({ getSelectOptions, history: { goBack }, inputs, isLoading, modifiedData, onChange, onSubmit, pluginHeaderProps, }) => { if (isLoading) { return ; } return ( <> {inputs.map(input => { return ( ); })} > ); }; SettingsViewWrapper.defaultProps = { getSelectOptions: () => {}, inputs: [], modifiedData: {}, onSubmit: () => {}, pluginHeaderProps: { actions: [], description: { id: 'app.utils.defaultMessage', }, title: { id: 'app.utils.defaultMessage', values: {}, }, }, }; SettingsViewWrapper.propTypes = { getSelectOptions: PropTypes.func, history: PropTypes.shape({ goBack: PropTypes.func.isRequired, }).isRequired, inputs: PropTypes.array, isLoading: PropTypes.bool.isRequired, modifiedData: PropTypes.object, onChange: PropTypes.func.isRequired, onSubmit: PropTypes.func, pluginHeaderProps: PropTypes.shape({ actions: PropTypes.array, description: PropTypes.shape({ id: PropTypes.string, }), title: PropTypes.shape({ id: PropTypes.string, values: PropTypes.object, }), }), }; export default withRouter(SettingsViewWrapper);