NotificationDeleteModal.jsx 1.9 KB

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