import React__default, { useContext } from 'react';
import { a as LocalizationContext } from '../../LocalizationContext-426f3d58.js';
import MessageInput from '../../ui/MessageInput.js';
import { u as useOpenChannelContext } from '../../OpenChannelProvider-1efcabea.js';
import '../../stringSet-a62108b2.js';
import '../../index-90420b99.js';
import '../../_rollupPluginBabelHelpers-a69fd1ce.js';
import 'prop-types';
import '../../const-ddd9d461.js';
import '../../const-9982664a.js';
import '../../ui/IconButton.js';
import '../../ui/Button.js';
import '../../index-4105bc4d.js';
import 'dompurify';
import '../../consts-15e764c0.js';
import '../../ui/Icon.js';
import '../../useSendbirdStateContext.js';
import '../../withSendbird.js';
import '../../index-f83f0aac.js';
import '../../utils/message/getOutgoingMessageState.js';
import '../../consts-f99cd0da.js';
import '../../consts-2eeaa3de.js';
import '../../tokenize-eec42500.js';
import '../../index.module-8bb7760e.js';
import '../../index-e7f4cbdf.js';
import '../../UserProfileContext-a59f0533.js';
import '../../compareIds-aca19765.js';
import '../../topics-247fcf3a.js';
import '@sendbird/chat';
import '@sendbird/chat/openChannel';
import '../../uuid-2e8efc75.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
