import React from 'react'; import PropTypes from 'prop-types'; import { gettext } from '../../utils/constants'; import { Modal, ModalBody, ModalFooter, Button } from 'reactstrap'; import SeahubModalHeader from '@/components/common/seahub-modal-header'; const propTypes = { currentResumableFile: PropTypes.object.isRequired, replaceRepetitionFile: PropTypes.func.isRequired, uploadFile: PropTypes.func.isRequired, cancelFileUpload: PropTypes.func.isRequired, }; class UploadRemindDialog extends React.Component { toggle = (e) => { e.nativeEvent.stopImmediatePropagation(); this.props.cancelFileUpload(); }; replaceRepetitionFile = (e) => { e.nativeEvent.stopImmediatePropagation(); this.props.replaceRepetitionFile(); }; uploadFile = (e) => { e.nativeEvent.stopImmediatePropagation(); this.props.uploadFile(); }; render() { const { fileName } = this.props.currentResumableFile; return ( {gettext('Replace file {filename}?').replace('{filename}', fileName)}

{gettext('A file with the same name already exists in this folder.')}

{gettext('Replacing it will overwrite its content.')}

); } } UploadRemindDialog.propTypes = propTypes; export default UploadRemindDialog;