import React__default, { useContext } from 'react';
import Modal from '../../ui/Modal.js';
import { ButtonTypes } from '../../ui/Button.js';
import { a as LocalizationContext } from '../../LocalizationContext-bcaf447a.js';
import { u as useChannelContext } from '../../ChannelProvider-205bb2b4.js';
import 'react-dom';
import '../../index-5ca598bf.js';
import '../../ui/Icon.js';
import 'prop-types';
import '../../ui/IconButton.js';
import '../../_rollupPluginBabelHelpers-52628376.js';
import '../../index-208f60f9.js';
import '../../stringSet-7f300d56.js';
import '../../MediaQueryContext-0d6b7936.js';
import '../../index-26c66412.js';
import '../../UserProfileContext-96f68187.js';
import '../../useSendbirdStateContext.js';
import '../../withSendbird.js';
import '../../const-4bc8cbc7.js';
import '../../index-0e63045e.js';
import '../../topics-50ed8c29.js';
import '../../index-46da725e.js';
import '../../utils/message/getOutgoingMessageState.js';
import '../../compareIds-c483b4db.js';
import '@sendbird/chat/groupChannel';
import '../../uuid-9e3aeec6.js';
import '@sendbird/chat/message';
import '../../consts-37c3d0a0.js';
import '../../resolvedReplyType-bfdfe6bd.js';

const RemoveMessage = props => {
  var _message$threadInfo;
  const {
    onSubmit = () => {/* noop */},
    onCancel,
    message
  } = props;
  const {
    stringSet
  } = useContext(LocalizationContext);
  const {
    deleteMessage
  } = useChannelContext();
  return /*#__PURE__*/React__default.createElement(Modal, {
    type: ButtonTypes.DANGER,
    disabled: (message === null || message === void 0 ? void 0 : (_message$threadInfo = message.threadInfo) === null || _message$threadInfo === void 0 ? void 0 : _message$threadInfo.replyCount) > 0,
    onCancel: onCancel,
    onSubmit: () => {
      deleteMessage(message).then(() => {
        onSubmit();
        onCancel();
      });
    },
    submitText: stringSet.MESSAGE_MENU__DELETE,
    titleText: stringSet.MODAL__DELETE_MESSAGE__TITLE
  });
};

export { RemoveMessage as default };
//# sourceMappingURL=RemoveMessageModal.js.map
