'use strict';

var React = require('react');
var ui_Modal = require('../../ui/Modal.js');
var ui_Button = require('../../ui/Button.js');
var LocalizationContext = require('../../LocalizationContext-9a1e0d36.js');
var Channel_context = require('../../ChannelProvider-a765f8a9.js');
require('react-dom');
require('../../index-3d069920.js');
require('../../ui/Icon.js');
require('prop-types');
require('../../ui/IconButton.js');
require('../../tslib.es6-259cb5ca.js');
require('../../index-d714b895.js');
require('../../stringSet-2696d00d.js');
require('../../MediaQueryContext-7f516d81.js');
require('../../index-6ca5c151.js');
require('../../UserProfileContext-2648d24c.js');
require('../../useSendbirdStateContext.js');
require('../../withSendbird.js');
require('../../_rollupPluginBabelHelpers-ada5a2bb.js');
require('../../index-5bc31321.js');
require('../../topics-528fde56.js');
require('../../index-b5c769e1.js');
require('../../utils/message/getOutgoingMessageState.js');
require('../../compareIds-03d1c5fd.js');
require('../../const-cd2f7184.js');
require('@sendbird/chat/groupChannel');
require('../../uuid-4e015383.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
