import React__default, { useContext } from 'react';
import Modal from '../../ui/Modal.js';
import { ButtonTypes } from '../../ui/Button.js';
import { a as LocalizationContext } from '../../LocalizationContext-1701e5c8.js';
import { u as useChannelContext } from '../../ChannelProvider-1dc36682.js';
import 'react-dom';
import '../../index-44c86e58.js';
import '../../ui/Icon.js';
import 'prop-types';
import '../../ui/IconButton.js';
import '../../_rollupPluginBabelHelpers-cc035350.js';
import '../../index-f50d7ab0.js';
import '../../stringSet-e9bb0333.js';
import '../../MediaQueryContext-e5b401d0.js';
import '../../index-ff8f2f61.js';
import '../../UserProfileContext-74e9a128.js';
import '../../useSendbirdStateContext.js';
import '../../withSendbird.js';
import '../../const-7c266a95.js';
import '../../index-5a62f6b7.js';
import '../../topics-0b30f52b.js';
import '../../index-99ab01f6.js';
import '../../utils/message/getOutgoingMessageState.js';
import '../../compareIds-367bb030.js';
import '@sendbird/chat/groupChannel';
import '../../uuid-8b344dd2.js';
import '@sendbird/chat/message';
import '../../consts-44eaef6b.js';
import '../../resolvedReplyType-6bb8f548.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
