import React__default, { useContext } from 'react';
import Modal from '../../ui/Modal.js';
import { a as ButtonTypes } from '../../index-6a47d16f.js';
import { a as LocalizationContext } from '../../LocalizationContext-2a073ef0.js';
import { u as useChannelContext } from '../../ChannelProvider-d891cf5f.js';
import 'react-dom';
import '../../index-c9cda9f6.js';
import '../../ui/Icon.js';
import '../../_rollupPluginBabelHelpers-3043541a.js';
import 'prop-types';
import '../../ui/IconButton.js';
import '../../tslib.es6-710c6267.js';
import '../../index-ed39099a.js';
import '../../stringSet-647493ce.js';
import '../../index-5ec69689.js';
import '../../UserProfileContext-143a6a42.js';
import '../../useSendbirdStateContext.js';
import '../../withSendbird.js';
import '../../index-7f2be3d7.js';
import '../../topics-18836011.js';
import '../../index-03ccaf35.js';
import '../../compareIds-2e073780.js';
import '../../const-b88f8299.js';
import '../../groupChannel-17ffbb7f.js';
import '../../__bundle-6316ce22-cd546820.js';
import '../../__bundle-fbda47dd-9dbeee1d.js';
import '../../__bundle-7dfccc8c-6c6e7ab4.js';
import '../../uuid-60ae25c1.js';
import '../../ui/ContextMenu.js';
import '../../ui/SortByRow.js';
import '../../ui/ReactionButton.js';
import '../../ui/ImageRenderer.js';

var RemoveMessage = function RemoveMessage(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 onSubmit() {
      deleteMessage(message).then(function () {
        onCancel();
      });
    },
    submitText: stringSet.MESSAGE_MENU__DELETE,
    titleText: stringSet.MODAL__DELETE_MESSAGE__TITLE
  });
};

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