import React__default, { useContext } from 'react';
import Modal from '../../ui/Modal.js';
import { ButtonTypes } from '../../ui/Button.js';
import { a as LocalizationContext } from '../../LocalizationContext-b2390bf8.js';
import { u as useChannelContext } from '../../ChannelProvider-498954bf.js';
import 'react-dom';
import '../../index-896545a0.js';
import '../../ui/Icon.js';
import 'prop-types';
import '../../ui/IconButton.js';
import '../../_rollupPluginBabelHelpers-4f8ebde4.js';
import '../../index-4372fcec.js';
import '../../stringSet-eefbc798.js';
import '../../MediaQueryContext-b4904a2e.js';
import '../../index-67135027.js';
import '../../UserProfileContext-d5787c95.js';
import '../../useSendbirdStateContext.js';
import '../../withSendbird.js';
import '../../const-97fac210.js';
import '../../index-2dc53ac2.js';
import '../../topics-f3629ea0.js';
import '../../index-eefb44ba.js';
import '../../utils/message/getOutgoingMessageState.js';
import '../../compareIds-7800035f.js';
import '@sendbird/chat/groupChannel';
import '../../uuid-a79b5ba8.js';
import '@sendbird/chat/message';
import '../../consts-33537265.js';
import '../../resolvedReplyType-e00d5fd9.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
