import React__default, { useContext } from 'react';
import Modal from '../../ui/Modal.js';
import { ButtonTypes } from '../../ui/Button.js';
import { a as LocalizationContext } from '../../LocalizationContext-a21fd99c.js';
import { u as useChannelContext } from '../../ChannelProvider-06a52df4.js';
import 'react-dom';
import '../../index-acdeddcd.js';
import '../../ui/Icon.js';
import 'prop-types';
import '../../ui/IconButton.js';
import '../../tslib.es6-7933cbb3.js';
import '../../index-4572759d.js';
import '../../stringSet-97b371bf.js';
import '../../index-2f7dc394.js';
import '../../UserProfileContext-804d6e7c.js';
import '../../useSendbirdStateContext.js';
import '../../withSendbird.js';
import '../../_rollupPluginBabelHelpers-3be2ec67.js';
import '../../index-58580f28.js';
import '../../topics-0034d31d.js';
import '../../index-c35128dd.js';
import '../../utils/message/getOutgoingMessageState.js';
import '../../compareIds-0e39568a.js';
import '../../const-05b7e2ee.js';
import '@sendbird/chat/groupChannel';
import '../../uuid-0426c252.js';
import '@sendbird/chat/message';
import '../../ui/ContextMenu.js';
import '../../ui/SortByRow.js';
import '../../ui/ReactionButton.js';
import '../../ui/ImageRenderer.js';

var RemoveMessage = function (props) {
  var _a;

  var 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 () {
        onCancel();
      });
    },
    submitText: stringSet.MESSAGE_MENU__DELETE,
    titleText: stringSet.MODAL__DELETE_MESSAGE__TITLE
  });
};

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