'use strict';

var React = require('react');
var ui_Modal = require('../../ui/Modal.js');
var ui_Button = require('../../index-f10a973e.js');
var LocalizationContext = require('../../LocalizationContext-c0dc9e2f.js');
var Channel_context = require('../../ChannelProvider-0dbd1be6.js');
require('prop-types');
require('react-dom');
require('../../index-0e3ec349.js');
require('../../ui/IconButton.js');
require('../../_rollupPluginBabelHelpers-59502943.js');
require('../../ui/Icon.js');
require('../../index-5755be7f.js');
require('../../stringSet-8a5752c1.js');
require('../../utils-0b87e6c8.js');
require('../../index-897ebaf9.js');
require('../../UserProfileContext-2bd8a987.js');
require('../../useSendbirdStateContext.js');
require('../../withSendbird.js');
require('../../index-f73b522b.js');
require('../../topics-5541d80a.js');
require('../../index-54177640.js');
require('../../tslib.es6-999b9d2f.js');
require('../../compareIds-70f7ec01.js');
require('../../const-cddf6176.js');
require('../../groupChannel-65c54bfa.js');
require('../../__bundle-7dfccc8c-92c0a42c.js');
require('../../uuid-c1af9ac6.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
