import React__default, { useContext } from 'react';
import Modal from '../../ui/Modal.js';
import { ButtonTypes } from '../../ui/Button.js';
import { a as LocalizationContext } from '../../LocalizationContext-57b46f6c.js';
import { u as useChannelContext } from '../../ChannelProvider-b41fde4c.js';
import 'react-dom';
import '../../index-7bff4ce0.js';
import '../../ui/Icon.js';
import 'prop-types';
import '../../ui/IconButton.js';
import '../../_rollupPluginBabelHelpers-0bc76382.js';
import '../../index-4023d1b2.js';
import '../../stringSet-7a8ce1ce.js';
import '../../MediaQueryContext-fbe7af77.js';
import '../../index-865112db.js';
import '../../UserProfileContext-29074346.js';
import '../../useSendbirdStateContext.js';
import '../../withSendbird.js';
import '../../index-f1701c11.js';
import '../../topics-5ff88d6f.js';
import '../../index-e2601165.js';
import '../../utils/message/getOutgoingMessageState.js';
import '../../compareIds-bc881fe7.js';
import '../../const-e51dda0c.js';
import '@sendbird/chat/groupChannel';
import '../../uuid-1f1bbd9c.js';
import '@sendbird/chat/message';
import '../../consts-3c0ff1ed.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
