import React__default, { useContext } from 'react';
import Modal from '../../ui/Modal.js';
import { ButtonTypes } from '../../ui/Button.js';
import { a as LocalizationContext } from '../../LocalizationContext-8725e9b2.js';
import { u as useChannelContext } from '../../ChannelProvider-c1c00018.js';
import 'react-dom';
import '../../index-10a05022.js';
import '../../ui/Icon.js';
import 'prop-types';
import '../../ui/IconButton.js';
import '../../tslib.es6-e1c2b6be.js';
import '../../index-e121c395.js';
import '../../stringSet-a513039b.js';
import '../../MediaQueryContext-ceb727c7.js';
import '../../index-c10fcd31.js';
import '../../UserProfileContext-cc71f901.js';
import '../../useSendbirdStateContext.js';
import '../../withSendbird.js';
import '../../_rollupPluginBabelHelpers-945410b2.js';
import '../../index-99933718.js';
import '../../topics-a581acbb.js';
import '../../index-43834bc0.js';
import '../../utils/message/getOutgoingMessageState.js';
import '../../compareIds-87972c5f.js';
import '../../const-85535a89.js';
import '@sendbird/chat/groupChannel';
import '../../uuid-d072af26.js';
import '@sendbird/chat/message';
import '../../ui/ContextMenu.js';
import '../../ui/SortByRow.js';
import '../../ui/ReactionButton.js';
import '../../ui/ImageRenderer.js';
import '../../consts-59f719d8.js';

var RemoveMessage = function (props) {
  var _a;

  var _b = props.onSubmit,
      onSubmit = _b === void 0 ? function () {} : _b,
      onCancel = props.onCancel,
      message = props.message;
  var stringSet = useContext(LocalizationContext).stringSet;
  var deleteMessage = useChannelContext().deleteMessage;
  return /*#__PURE__*/React__default.createElement(Modal, {
    type: ButtonTypes.DANGER,
    disabled: ((_a = message === null || message === void 0 ? void 0 : message.threadInfo) === null || _a === void 0 ? void 0 : _a.replyCount) > 0,
    onCancel: onCancel,
    onSubmit: function () {
      deleteMessage(message).then(function () {
        onSubmit();
        onCancel();
      });
    },
    submitText: stringSet.MESSAGE_MENU__DELETE,
    titleText: stringSet.MODAL__DELETE_MESSAGE__TITLE
  });
};

export { RemoveMessage as default };
//# sourceMappingURL=RemoveMessageModal.js.map
