import React__default, { useContext } from 'react';
import { a as LocalizationContext } from '../../LocalizationContext-b2390bf8.js';
import MessageInput from '../../ui/MessageInput.js';
import { u as useOpenChannelContext } from '../../OpenChannelProvider-d0f0bf3a.js';
import '../../stringSet-eefbc798.js';
import '../../index-67135027.js';
import '../../_rollupPluginBabelHelpers-4f8ebde4.js';
import 'prop-types';
import '../../const-922f4cc5.js';
import '../../const-97fac210.js';
import '../../ui/IconButton.js';
import '../../ui/Button.js';
import '../../index-4372fcec.js';
import 'dompurify';
import '../../consts-8ce876a0.js';
import '../../ui/Icon.js';
import '../../useSendbirdStateContext.js';
import '../../withSendbird.js';
import '../../index-eefb44ba.js';
import '../../utils/message/getOutgoingMessageState.js';
import '../../consts-e3e03145.js';
import '../../consts-cdccf171.js';
import '../../tokenize-b97bc343.js';
import '../../index.module-2885df8c.js';
import '../../index-2dc53ac2.js';
import '../../UserProfileContext-d5787c95.js';
import '../../compareIds-7800035f.js';
import '../../topics-f3629ea0.js';
import '@sendbird/chat';
import '@sendbird/chat/openChannel';
import '../../uuid-a79b5ba8.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
