NotificationDeleteModal.jsx 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import React from 'react';
  2. import { useTranslation } from 'next-i18next';
  3. import PropTypes from 'prop-types';
  4. import {
  5. Modal, ModalHeader, ModalBody, ModalFooter,
  6. } from 'reactstrap';
  7. class NotificationDeleteModal extends React.PureComponent {
  8. render() {
  9. const { t, notificationForConfiguration } = this.props;
  10. return (
  11. <Modal isOpen={this.props.isOpen} toggle={this.props.onClose}>
  12. <ModalHeader tag="h4" toggle={this.props.onClose} className="bg-danger text-light">
  13. <i className="icon icon-fire"></i> Delete Global Notification Setting
  14. </ModalHeader>
  15. <ModalBody>
  16. <p>
  17. {t('notification_settings.delete_notification_pattern_desc1', { path: notificationForConfiguration.triggerPath })}
  18. </p>
  19. <p className="text-danger">
  20. {t('notification_settings.delete_notification_pattern_desc2')}
  21. </p>
  22. </ModalBody>
  23. <ModalFooter>
  24. <button type="button" className="btn btn-sm btn-danger" onClick={this.props.onClickSubmit}>
  25. <i className="icon icon-fire"></i> {t('Delete')}
  26. </button>
  27. </ModalFooter>
  28. </Modal>
  29. );
  30. }
  31. }
  32. NotificationDeleteModal.propTypes = {
  33. t: PropTypes.func.isRequired, // i18next
  34. isOpen: PropTypes.bool.isRequired,
  35. onClose: PropTypes.func.isRequired,
  36. onClickSubmit: PropTypes.func.isRequired,
  37. notificationForConfiguration: PropTypes.object.isRequired,
  38. };
  39. // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
  40. const NotificationDeleteModalWrapperFC = (props) => {
  41. const { t } = useTranslation('admin');
  42. return <NotificationDeleteModal t={t} {...props} />;
  43. };
  44. export default NotificationDeleteModalWrapperFC;