'use strict';

var React = require('react');
var LocalizationContext = require('../../LocalizationContext-bc6af64a.js');
var ui_MessageInput = require('../../ui/MessageInput.js');
var OpenChannel_context = require('../../OpenChannelProvider-8ef4ee2e.js');
require('../../stringSet-812981b5.js');
require('../../index-c08c7ef8.js');
require('../../_rollupPluginBabelHelpers-00480ba8.js');
require('prop-types');
require('../../const-eb6bfc42.js');
require('../../const-f1c7b0cf.js');
require('../../ui/IconButton.js');
require('../../ui/Button.js');
require('../../index-902525e0.js');
require('dompurify');
require('../../consts-c63fe2cd.js');
require('../../ui/Icon.js');
require('../../useSendbirdStateContext.js');
require('../../withSendbird.js');
require('../../index-609a0bf5.js');
require('../../utils/message/getOutgoingMessageState.js');
require('../../consts-db7e33d3.js');
require('../../consts-20c3e20f.js');
require('../../tokenize-846b6f86.js');
require('../../index.module-ceb5d636.js');
require('../../index-a9099968.js');
require('../../UserProfileContext-268ad0d1.js');
require('../../compareIds-a65972c5.js');
require('../../topics-623a82c5.js');
require('@sendbird/chat');
require('@sendbird/chat/openChannel');
require('../../uuid-43555bb8.js');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var React__default = /*#__PURE__*/_interopDefaultLegacy(React);

const MessageInputWrapper = (props, ref) => {
  const {
    currentOpenChannel,
    disabled,
    handleSendMessage,
    handleFileUpload,
    amIMuted
  } = OpenChannel_context.useOpenChannelContext();
  const channel = currentOpenChannel;
  const {
    stringSet
  } = React.useContext(LocalizationContext.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["default"].createElement("div", {
    className: "sendbird-openchannel-footer"
  }, /*#__PURE__*/React__default["default"].createElement(ui_MessageInput, {
    channel: currentOpenChannel,
    ref: ref,
    value: value,
    disabled: disabled,
    isVoiceMessageEnabled: false,
    onSendMessage: handleSendMessage,
    onFileUpload: handleFileUpload,
    placeholder: getPlaceHolderString()
  }));
};
var OpenChannelInput = /*#__PURE__*/React__default["default"].forwardRef(MessageInputWrapper);

module.exports = OpenChannelInput;
//# sourceMappingURL=OpenChannelInput.js.map
