import React__default, { useContext } from 'react';
import Modal from '../../ui/Modal.js';
import { ButtonTypes } from '../../ui/Button.js';
import { a as LocalizationContext } from '../../LocalizationContext-fd0d32ab.js';
import { u as useChannelContext } from '../../ChannelProvider-675be930.js';
import 'react-dom';
import '../../index-8b78f6b4.js';
import '../../ui/Icon.js';
import 'prop-types';
import '../../ui/IconButton.js';
import '../../tslib.es6-46e4c379.js';
import '../../index-dfa71ceb.js';
import '../../stringSet-eb4a64cb.js';
import '../../index-ce08211b.js';
import '../../UserProfileContext-d36099b1.js';
import '../../useSendbirdStateContext.js';
import '../../withSendbird.js';
import '../../_rollupPluginBabelHelpers-f6b9b32e.js';
import '../../index-94381d3a.js';
import '../../topics-307251cc.js';
import '../../index-f6fd2b53.js';
import '../../compareIds-4bd391cb.js';
import '../../const-e71ab906.js';
import '../../groupChannel-a10aea7a.js';
import '../../__bundle-57e0c5af-4e9165b5.js';
import '../../__bundle-0dad34cd-10d4f218.js';
import '../../__bundle-bd072f34-1aaac363.js';
import '../../uuid-e8248f01.js';
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
