EmptyTrashModal.jsx 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import {
  4. Modal, ModalHeader, ModalBody, ModalFooter,
  5. } from 'reactstrap';
  6. import { withTranslation } from 'react-i18next';
  7. const EmptyTrashModal = (props) => {
  8. const {
  9. t, isOpen, toggle, onClickSubmit,
  10. } = props;
  11. return (
  12. <Modal isOpen={isOpen} toggle={toggle} className="grw-create-page">
  13. <ModalHeader tag="h4" toggle={toggle} className="bg-danger text-light">
  14. { t('modal_empty.empty_the_trash')}
  15. </ModalHeader>
  16. <ModalBody>
  17. { t('modal_empty.notice')}
  18. </ModalBody>
  19. <ModalFooter>
  20. {/* TODO add error message */}
  21. <button type="button" className="btn btn-danger" onClick={onClickSubmit}>
  22. <i className="icon-trash mr-2" aria-hidden="true"></i>Empty
  23. </button>
  24. </ModalFooter>
  25. </Modal>
  26. );
  27. };
  28. EmptyTrashModal.propTypes = {
  29. t: PropTypes.func.isRequired, // i18next
  30. isOpen: PropTypes.bool.isRequired,
  31. toggle: PropTypes.func.isRequired,
  32. onClickSubmit: PropTypes.func.isRequired,
  33. };
  34. export default withTranslation()(EmptyTrashModal);