import React__default, { useContext } from 'react';
import Modal from '../../ui/Modal.js';
import { ButtonTypes } from '../../ui/Button.js';
import { a as LocalizationContext } from '../../LocalizationContext-a6aa8be8.js';
import { u as useChannelContext } from '../../ChannelProvider-def8e42f.js';
import 'react-dom';
import '../../index-d4908e3c.js';
import '../../ui/Icon.js';
import 'prop-types';
import '../../ui/IconButton.js';
import '../../tslib.es6-cd680863.js';
import '../../index-67c5e94c.js';
import '../../stringSet-ad8993d1.js';
import '../../MediaQueryContext-a551e770.js';
import '../../index-757a563a.js';
import '../../UserProfileContext-dd096494.js';
import '../../useSendbirdStateContext.js';
import '../../withSendbird.js';
import '../../_rollupPluginBabelHelpers-3e5825fa.js';
import '../../index-6ccea9a6.js';
import '../../topics-9fbe0d61.js';
import '../../index-8ee9e1f5.js';
import '../../utils/message/getOutgoingMessageState.js';
import '../../compareIds-c8335d61.js';
import '../../const-e27598a1.js';
import '@sendbird/chat/groupChannel';
import '../../uuid-9f7da91d.js';
import '@sendbird/chat/message';
import '../../ui/ContextMenu.js';
import '../../ui/SortByRow.js';
import '../../ui/ReactionButton.js';
import '../../ui/ImageRenderer.js';
import '../../consts-886b25ca.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
