import React__default, { useContext } from 'react';
import { a as LocalizationContext } from '../../LocalizationContext-bcaf447a.js';
import MessageInput from '../../ui/MessageInput.js';
import { u as useOpenChannelContext } from '../../OpenChannelProvider-770c207c.js';
import '../../stringSet-7f300d56.js';
import '../../index-26c66412.js';
import '../../_rollupPluginBabelHelpers-52628376.js';
import 'prop-types';
import '../../const-c64639fc.js';
import '../../const-4bc8cbc7.js';
import '../../ui/IconButton.js';
import '../../ui/Button.js';
import '../../index-208f60f9.js';
import 'dompurify';
import '../../consts-acdc6c08.js';
import '../../ui/Icon.js';
import '../../useSendbirdStateContext.js';
import '../../withSendbird.js';
import '../../index-46da725e.js';
import '../../utils/message/getOutgoingMessageState.js';
import '../../consts-c99872c0.js';
import '../../consts-cf7328d6.js';
import '../../tokenize-aa91b5a4.js';
import '../../index.module-6fe8c3f8.js';
import '../../index-0e63045e.js';
import '../../UserProfileContext-96f68187.js';
import '../../compareIds-c483b4db.js';
import '../../topics-50ed8c29.js';
import '@sendbird/chat';
import '@sendbird/chat/openChannel';
import '../../uuid-9e3aeec6.js';

const MessageInputWrapper = (props, ref) => {
  const {
    currentOpenChannel,
    disabled,
    handleSendMessage,
    handleFileUpload,
    amIMuted
  } = useOpenChannelContext();
  const channel = currentOpenChannel;
  const {
    stringSet
  } = useContext(LocalizationContext);
  const {
    value
  } = props;
  function getPlaceHolderString() {
    if (amIMuted) {
      return stringSet.MESSAGE_INPUT__PLACE_HOLDER__MUTED;
    }
    if (disabled) {
      return stringSet.MESSAGE_INPUT__PLACE_HOLDER__DISABLED;
    }
    return '';
  }
  if (!channel) {
    return null;
  }
  return /*#__PURE__*/React__default.createElement("div", {
    className: "sendbird-openchannel-footer"
  }, /*#__PURE__*/React__default.createElement(MessageInput, {
    channel: currentOpenChannel,
    ref: ref,
    value: value,
    disabled: disabled,
    isVoiceMessageEnabled: false,
    onSendMessage: handleSendMessage,
    onFileUpload: handleFileUpload,
    placeholder: getPlaceHolderString()
  }));
};
var OpenChannelInput = /*#__PURE__*/React__default.forwardRef(MessageInputWrapper);

export { OpenChannelInput as default };
//# sourceMappingURL=OpenChannelInput.js.map
