import PropTypes from 'prop-types'; import { Typography, TextField, Button, Icon } from '@material-ui/core'; import PageContent from '../../common/PageContent/PageContent'; import ConditionallyRender from '../../common/ConditionallyRender/ConditionallyRender'; import { styles as commonStyles, FormButtons } from '../../common'; import { trim } from '../../common/util'; import StrategyParameters from './StrategyParameters/StrategyParameters'; const CreateStrategy = ({ input, setValue, appParameter, onCancel, editMode = false, errors, onSubmit, clearErrors, updateParameter, }) => { const getHeaderTitle = () => { if (editMode) return 'Edit strategy'; return 'Create a new strategy'; }; return ( Be careful! Changing a strategy definition might also require changes to the implementation in the clients. } />
{ clearErrors(); setValue('name', trim(target.value)); }} value={input.name} variant="outlined" size="small" /> setValue('description', target.value) } value={input.description} variant="outlined" size="small" />
); }; CreateStrategy.propTypes = { input: PropTypes.object, setValue: PropTypes.func, appParameter: PropTypes.func, updateParameter: PropTypes.func, clear: PropTypes.func, onCancel: PropTypes.func, onSubmit: PropTypes.func, errors: PropTypes.object, editMode: PropTypes.bool, clearErrors: PropTypes.func, }; export default CreateStrategy;