import React__default, { useContext } from 'react';
import Modal from '../../ui/Modal.js';
import { a as ButtonTypes } from '../../index-ff084076.js';
import { a as LocalizationContext } from '../../LocalizationContext-1417e9d3.js';
import { u as useChannelContext } from '../../ChannelProvider-6ea29e4a.js';
import 'prop-types';
import 'react-dom';
import '../../index-b9a5ff91.js';
import '../../ui/IconButton.js';
import '../../_rollupPluginBabelHelpers-87a4819d.js';
import '../../ui/Icon.js';
import '../../index-fdcc4a92.js';
import '../../stringSet-adf0eb59.js';
import '../../utils-e6f6eb1b.js';
import '../../index-097f4b78.js';
import '../../UserProfileContext-c72e5006.js';
import '../../useSendbirdStateContext.js';
import '../../withSendbird.js';
import '../../index-89c172fc.js';
import '../../topics-29b13da4.js';
import '../../index-e647d770.js';
import '../../tslib.es6-5a2250f9.js';
import '../../compareIds-9b3202b9.js';
import '../../const-c2efe3b4.js';
import '../../groupChannel-7e48e30f.js';
import '../../__bundle-7dfccc8c-be772b9c.js';
import '../../uuid-9ac267fb.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
