'use strict';

var React = require('react');
var ui_Modal = require('../../ui/Modal.js');
var ui_Button = require('../../ui/Button.js');
var LocalizationContext = require('../../LocalizationContext-c5621c61.js');
var Channel_context = require('../../ChannelProvider-fe11259c.js');
require('react-dom');
require('../../index-a2d8a3f3.js');
require('../../ui/Icon.js');
require('prop-types');
require('../../ui/IconButton.js');
require('../../tslib.es6-e8b55af5.js');
require('../../index-5bd7c9b7.js');
require('../../stringSet-a5740c90.js');
require('../../MediaQueryContext-99c19e78.js');
require('../../index-43d1b90a.js');
require('../../UserProfileContext-aff2c5f8.js');
require('../../useSendbirdStateContext.js');
require('../../withSendbird.js');
require('../../_rollupPluginBabelHelpers-3efc8c18.js');
require('../../index-2b47ddd2.js');
require('../../topics-c7a97b32.js');
require('../../index-9091da93.js');
require('../../utils/message/getOutgoingMessageState.js');
require('../../compareIds-6b0c325b.js');
require('../../const-91723167.js');
require('@sendbird/chat/groupChannel');
require('../../uuid-f67dc419.js');
require('@sendbird/chat/message');
require('../../ui/ContextMenu.js');
require('../../ui/SortByRow.js');
require('../../ui/ReactionButton.js');
require('../../ui/ImageRenderer.js');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var React__default = /*#__PURE__*/_interopDefaultLegacy(React);

var RemoveMessage = function (props) {
  var _a;

  var onCancel = props.onCancel,
      message = props.message;
  var stringSet = React.useContext(LocalizationContext.LocalizationContext).stringSet;
  var deleteMessage = Channel_context.useChannelContext().deleteMessage;
  return /*#__PURE__*/React__default["default"].createElement(ui_Modal["default"], {
    type: ui_Button.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
  });
};

module.exports = RemoveMessage;
//# sourceMappingURL=RemoveMessageModal.js.map
