import React__default, { useContext } from 'react';
import Modal from '../../ui/Modal.js';
import { ButtonTypes } from '../../ui/Button.js';
import { a as LocalizationContext } from '../../LocalizationContext-426f3d58.js';
import { u as useChannelContext } from '../../ChannelProvider-3bd92d16.js';
import 'react-dom';
import '../../index-3e548496.js';
import '../../ui/Icon.js';
import 'prop-types';
import '../../ui/IconButton.js';
import '../../_rollupPluginBabelHelpers-a69fd1ce.js';
import '../../index-4105bc4d.js';
import '../../stringSet-a62108b2.js';
import '../../MediaQueryContext-b531adc9.js';
import '../../index-90420b99.js';
import '../../UserProfileContext-a59f0533.js';
import '../../useSendbirdStateContext.js';
import '../../withSendbird.js';
import '../../const-9982664a.js';
import '../../index-e7f4cbdf.js';
import '../../topics-247fcf3a.js';
import '../../index-f83f0aac.js';
import '../../utils/message/getOutgoingMessageState.js';
import '../../compareIds-aca19765.js';
import '@sendbird/chat/groupChannel';
import '../../uuid-2e8efc75.js';
import '@sendbird/chat/message';
import '../../consts-e64103c6.js';
import '../../resolvedReplyType-7bde5f56.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
