import React__default, { useContext } from 'react';
import { a as LocalizationContext } from '../../LocalizationContext-a82461b5.js';
import MessageInput from '../../ui/MessageInput.js';
import { u as useOpenChannelContext } from '../../OpenChannelProvider-b9104634.js';
import '../../stringSet-b60e9529.js';
import '../../index-6add7940.js';
import '../../_rollupPluginBabelHelpers-05128ded.js';
import 'prop-types';
import '../../const-3a34a127.js';
import '../../const-72f012b6.js';
import '../../ui/IconButton.js';
import '../../ui/Button.js';
import '../../index-6420013c.js';
import 'dompurify';
import '../../consts-b4cb83cf.js';
import '../../ui/Icon.js';
import '../../useSendbirdStateContext.js';
import '../../withSendbird.js';
import '../../index-579ca9d7.js';
import '../../utils/message/getOutgoingMessageState.js';
import '../../consts-7693b8d3.js';
import '../../consts-9469111b.js';
import '../../tokenize-c718324d.js';
import '../../index.module-4f1cd64e.js';
import '../../index-ccef08fe.js';
import '../../UserProfileContext-f3f446d2.js';
import '../../compareIds-2e50e905.js';
import '../../topics-eb548880.js';
import '@sendbird/chat';
import '@sendbird/chat/openChannel';
import '../../uuid-717930b4.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
