import React__default, { useContext } from 'react';
import Modal from '../../ui/Modal.js';
import { ButtonTypes } from '../../ui/Button.js';
import { a as LocalizationContext } from '../../LocalizationContext-a82461b5.js';
import { u as useChannelContext } from '../../ChannelProvider-5dcbee7b.js';
import 'react-dom';
import '../../index-a9101009.js';
import '../../ui/Icon.js';
import 'prop-types';
import '../../ui/IconButton.js';
import '../../_rollupPluginBabelHelpers-05128ded.js';
import '../../index-6420013c.js';
import '../../stringSet-b60e9529.js';
import '../../MediaQueryContext-d6110905.js';
import '../../index-6add7940.js';
import '../../UserProfileContext-f3f446d2.js';
import '../../useSendbirdStateContext.js';
import '../../withSendbird.js';
import '../../const-72f012b6.js';
import '../../index-ccef08fe.js';
import '../../topics-eb548880.js';
import '../../index-579ca9d7.js';
import '../../utils/message/getOutgoingMessageState.js';
import '../../compareIds-2e50e905.js';
import '@sendbird/chat/groupChannel';
import '../../uuid-717930b4.js';
import '@sendbird/chat/message';
import '../../consts-fa6ab3c0.js';
import '../../resolvedReplyType-9d00a3db.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
