import React__default, { useContext } from 'react';
import { a as LocalizationContext } from '../../LocalizationContext-57b46f6c.js';
import MessageInput from '../../ui/MessageInput.js';
import { u as useOpenChannelContext } from '../../OpenChannelProvider-b634e564.js';
import '../../stringSet-7a8ce1ce.js';
import '../../index-865112db.js';
import '../../_rollupPluginBabelHelpers-0bc76382.js';
import 'prop-types';
import '../../const-8daee9fc.js';
import '../../const-e51dda0c.js';
import '../../ui/IconButton.js';
import '../../ui/Button.js';
import '../../index-4023d1b2.js';
import 'dompurify';
import '../../consts-d0b365df.js';
import '../../ui/Icon.js';
import '../../index-e2601165.js';
import '../../utils/message/getOutgoingMessageState.js';
import '../../consts-d0cfee49.js';
import '../../consts-7aab5aff.js';
import '../../tokenize-003bf3f7.js';
import '../../index-f1701c11.js';
import '../../UserProfileContext-29074346.js';
import '../../compareIds-bc881fe7.js';
import '../../topics-5ff88d6f.js';
import '@sendbird/chat';
import '@sendbird/chat/openChannel';
import '../../uuid-1f1bbd9c.js';
import '../../useSendbirdStateContext.js';
import '../../withSendbird.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, {
    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
