import React__default, { useContext } from 'react';
import { a as LocalizationContext } from '../../LocalizationContext-1701e5c8.js';
import MessageInput from '../../ui/MessageInput.js';
import { u as useOpenChannelContext } from '../../OpenChannelProvider-995a7397.js';
import '../../stringSet-e9bb0333.js';
import '../../index-ff8f2f61.js';
import '../../_rollupPluginBabelHelpers-cc035350.js';
import 'prop-types';
import '../../const-2e67461b.js';
import '../../const-7c266a95.js';
import '../../ui/IconButton.js';
import '../../ui/Button.js';
import '../../index-f50d7ab0.js';
import 'dompurify';
import '../../consts-a0834b70.js';
import '../../ui/Icon.js';
import '../../useSendbirdStateContext.js';
import '../../withSendbird.js';
import '../../index-99ab01f6.js';
import '../../utils/message/getOutgoingMessageState.js';
import '../../consts-3a33a0a8.js';
import '../../consts-b3274b3d.js';
import '../../tokenize-d12690c3.js';
import '../../index.module-d24badee.js';
import '../../index-5a62f6b7.js';
import '../../UserProfileContext-74e9a128.js';
import '../../compareIds-367bb030.js';
import '../../topics-0b30f52b.js';
import '@sendbird/chat';
import '@sendbird/chat/openChannel';
import '../../uuid-8b344dd2.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
