import React__default, { useContext } from 'react';
import Modal from '../../ui/Modal.js';
import { ButtonTypes } from '../../ui/Button.js';
import { a as LocalizationContext } from '../../LocalizationContext-187f787e.js';
import { u as useChannelContext } from '../../ChannelProvider-e2c86cba.js';
import 'react-dom';
import '../../index-f338f866.js';
import '../../ui/Icon.js';
import 'prop-types';
import '../../ui/IconButton.js';
import '../../tslib.es6-645dedf8.js';
import '../../index-46d8dde5.js';
import '../../stringSet-fd70cba0.js';
import '../../MediaQueryContext-add671c4.js';
import '../../index-5b34a381.js';
import '../../UserProfileContext-d2264917.js';
import '../../useSendbirdStateContext.js';
import '../../withSendbird.js';
import '../../_rollupPluginBabelHelpers-dfc61977.js';
import '../../index-c55389dc.js';
import '../../topics-c4837013.js';
import '../../index-102fbe62.js';
import '../../utils/message/getOutgoingMessageState.js';
import '../../compareIds-86584ff3.js';
import '../../const-26fafb08.js';
import '@sendbird/chat/groupChannel';
import '../../uuid-e15650df.js';
import '@sendbird/chat/message';
import '../../ui/ContextMenu.js';
import '../../ui/SortByRow.js';
import '../../ui/ReactionButton.js';
import '../../ui/ImageRenderer.js';
import '../../consts-37ea645a.js';

var RemoveMessage = function (props) {
  var _a;

  var _b = props.onSubmit,
      onSubmit = _b === void 0 ? function () {} : _b,
      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 () {
        onSubmit();
        onCancel();
      });
    },
    submitText: stringSet.MESSAGE_MENU__DELETE,
    titleText: stringSet.MODAL__DELETE_MESSAGE__TITLE
  });
};

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