'use strict';

var React = require('react');
var ui_Modal = require('../../ui/Modal.js');
var ui_Button = require('../../ui/Button.js');
var LocalizationContext = require('../../LocalizationContext-1f00818c.js');
var Channel_context = require('../../ChannelProvider-dbb1d52e.js');
require('react-dom');
require('../../index-8c25d6aa.js');
require('../../ui/Icon.js');
require('prop-types');
require('../../ui/IconButton.js');
require('../../tslib.es6-7d75f2e2.js');
require('../../index-8d7a94e3.js');
require('../../stringSet-410775ff.js');
require('../../index-d82f6dd1.js');
require('../../UserProfileContext-3a4f0132.js');
require('../../useSendbirdStateContext.js');
require('../../withSendbird.js');
require('../../_rollupPluginBabelHelpers-6917423d.js');
require('../../index-a11fb495.js');
require('../../topics-9747398e.js');
require('../../index-177380fc.js');
require('../../compareIds-8d064912.js');
require('../../const-67a2a885.js');
require('../../groupChannel-05c7f9f8.js');
require('../../__bundle-57e0c5af-b8304f7a.js');
require('../../__bundle-0dad34cd-bd827f82.js');
require('../../__bundle-bd072f34-578ccb1e.js');
require('../../uuid-c813a8a1.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 (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
