import PropTypes from 'prop-types'; import React from 'react'; import { inputTypes, kinds } from 'Helpers/Props'; import { stringSettingShape } from 'Helpers/Props/Shapes/settingShape'; import Button from 'Components/Link/Button'; import SpinnerErrorButton from 'Components/Link/SpinnerErrorButton'; import LoadingIndicator from 'Components/Loading/LoadingIndicator'; import ModalContent from 'Components/Modal/ModalContent'; import ModalHeader from 'Components/Modal/ModalHeader'; import ModalBody from 'Components/Modal/ModalBody'; import ModalFooter from 'Components/Modal/ModalFooter'; import Form from 'Components/Form/Form'; import FormGroup from 'Components/Form/FormGroup'; import FormLabel from 'Components/Form/FormLabel'; import FormInputGroup from 'Components/Form/FormInputGroup'; import styles from './EditRemotePathMappingModalContent.css'; function EditRemotePathMappingModalContent(props) { const { id, isFetching, error, isSaving, saveError, item, downloadClientHosts, onInputChange, onSavePress, onModalClose, onDeleteRemotePathMappingPress, ...otherProps } = props; const { host, remotePath, localPath } = item; return ( {id ? 'Edit Remote Path Mapping' : 'Add Remote Path Mapping'} { isFetching && } { !isFetching && !!error &&
Unable to add a new remote path mapping, please try again.
} { !isFetching && !error &&
Host Remote Path Local Path
}
{ id && } Save
); } const remotePathMappingShape = { host: PropTypes.shape(stringSettingShape).isRequired, remotePath: PropTypes.shape(stringSettingShape).isRequired, localPath: PropTypes.shape(stringSettingShape).isRequired }; EditRemotePathMappingModalContent.propTypes = { id: PropTypes.number, isFetching: PropTypes.bool.isRequired, error: PropTypes.object, isSaving: PropTypes.bool.isRequired, saveError: PropTypes.object, item: PropTypes.shape(remotePathMappingShape).isRequired, downloadClientHosts: PropTypes.arrayOf(PropTypes.object).isRequired, onInputChange: PropTypes.func.isRequired, onSavePress: PropTypes.func.isRequired, onModalClose: PropTypes.func.isRequired, onDeleteRemotePathMappingPress: PropTypes.func }; export default EditRemotePathMappingModalContent;