import React__default, { useContext } from 'react';
import Modal from '../../ui/Modal.js';
import { ButtonTypes } from '../../ui/Button.js';
import { a as LocalizationContext } from '../../LocalizationContext-9c54e783.js';
import { u as useChannelContext } from '../../ChannelProvider-4ab3a851.js';
import 'react-dom';
import '../../index-2a938266.js';
import '../../ui/Icon.js';
import 'prop-types';
import '../../ui/IconButton.js';
import '../../_rollupPluginBabelHelpers-b2d9bfc5.js';
import '../../index-4111594a.js';
import '../../stringSet-1f18348a.js';
import '../../MediaQueryContext-1988a4bc.js';
import '../../index-a9ddd0f5.js';
import '../../UserProfileContext-a8aa4c0f.js';
import '../../useSendbirdStateContext.js';
import '../../withSendbird.js';
import '../../index-f48cfdf7.js';
import '../../topics-d8d10f83.js';
import '../../index-dbe0e004.js';
import '../../utils/message/getOutgoingMessageState.js';
import '../../compareIds-1e0e668f.js';
import '../../const-5f722b91.js';
import '@sendbird/chat/groupChannel';
import '../../uuid-48baadaf.js';
import '@sendbird/chat/message';
import '../../ui/ContextMenu.js';
import '../../ui/SortByRow.js';
import '../../ui/ReactionButton.js';
import '../../ui/ImageRenderer.js';
import '../../consts-c9746f2b.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
