'use strict';

var React = require('react');
var ui_Modal = require('../../ui/Modal.js');
var ui_Button = require('../../index-05692021.js');
var LocalizationContext = require('../../LocalizationContext-da62a103.js');
var Channel_context = require('../../ChannelProvider-b21b3c2a.js');
require('react-dom');
require('../../index-32562627.js');
require('../../ui/Icon.js');
require('../../_rollupPluginBabelHelpers-4265e501.js');
require('prop-types');
require('../../ui/IconButton.js');
require('../../tslib.es6-ba69891c.js');
require('../../index-089e0fba.js');
require('../../stringSet-857a128c.js');
require('../../index-25336220.js');
require('../../UserProfileContext-891590a7.js');
require('../../useSendbirdStateContext.js');
require('../../withSendbird.js');
require('../../index-f5cb5c7f.js');
require('../../topics-a755c9c6.js');
require('../../index-06c3dca9.js');
require('../../compareIds-26079db4.js');
require('../../const-c1a4604d.js');
require('../../groupChannel-11ed3837.js');
require('../../__bundle-6316ce22-c06e03fc.js');
require('../../__bundle-fbda47dd-1a2c2d97.js');
require('../../__bundle-7dfccc8c-dcc1c854.js');
require('../../uuid-49679ac2.js');
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 RemoveMessage(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 onSubmit() {
      deleteMessage(message).then(function () {
        onCancel();
      });
    },
    submitText: stringSet.MESSAGE_MENU__DELETE,
    titleText: stringSet.MODAL__DELETE_MESSAGE__TITLE
  });
};

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