import React__default, { useContext } from 'react';
import Modal from '../../ui/Modal.js';
import { a as ButtonTypes } from '../../index-a3d218da.js';
import { a as LocalizationContext } from '../../LocalizationContext-bed38f81.js';
import { u as useChannelContext } from '../../ChannelProvider-38147c7b.js';
import 'prop-types';
import 'react-dom';
import '../../index-7ed67f3f.js';
import '../../ui/IconButton.js';
import '../../_rollupPluginBabelHelpers-51451000.js';
import '../../ui/Icon.js';
import '../../index-33456100.js';
import '../../stringSet-07d51930.js';
import '../../utils-af217adb.js';
import '../../index-6e02fc15.js';
import '../../UserProfileContext-5bc5ff98.js';
import '../../useSendbirdStateContext.js';
import '../../withSendbird.js';
import '../../index-1984c852.js';
import '../../topics-a5f3f0e9.js';
import '../../index-c67f2f3b.js';
import '../../tslib.es6-7a52c497.js';
import '../../compareIds-7eaf62a5.js';
import '../../const-db8ec16d.js';
import '../../groupChannel-5c43b7c1.js';
import '../../__bundle-7dfccc8c-dc566919.js';
import '../../uuid-b7da2ddf.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
