'use strict';

var React = require('react');
var LocalizationContext = require('../../LocalizationContext-458c4425.js');
var ui_MessageInput = require('../../ui/MessageInput.js');
var OpenChannel_context = require('../../OpenChannelProvider-0f1ece78.js');
require('../../stringSet-1e20a383.js');
require('../../index-0d759d2f.js');
require('../../_rollupPluginBabelHelpers-7a2f7ed5.js');
require('prop-types');
require('../../const-496c4e96.js');
require('../../const-290e012b.js');
require('../../ui/IconButton.js');
require('../../index-e61b5129.js');
require('../../index-0913b626.js');
require('../../ui/MentionUserLabel.js');
require('../../ui/Icon.js');
require('../../index-1e767390.js');
require('../../tslib.es6-94adc177.js');
require('../../index-7efec35e.js');
require('../../UserProfileContext-f582734c.js');
require('../../compareIds-8bbbef9c.js');
require('../../topics-fae1bf42.js');
require('../../openChannel-e4e021c5.js');
require('../../__bundle-7dfccc8c-1748a942.js');
require('../../uuid-54ad2cc3.js');
require('../../useSendbirdStateContext.js');
require('../../withSendbird.js');

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

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

var MessageInputWrapper = function MessageInputWrapper(props, ref) {
  var _a = OpenChannel_context.useOpenChannelContext(),
      currentOpenChannel = _a.currentOpenChannel,
      disabled = _a.disabled,
      handleSendMessage = _a.handleSendMessage,
      handleFileUpload = _a.handleFileUpload;

  var channel = currentOpenChannel;

  if (!channel) {
    return;
  }

  var stringSet = React.useContext(LocalizationContext.LocalizationContext).stringSet;
  return /*#__PURE__*/React__default["default"].createElement("div", {
    className: "sendbird-openchannel-footer"
  }, /*#__PURE__*/React__default["default"].createElement(ui_MessageInput, {
    ref: ref,
    disabled: disabled,
    onSendMessage: handleSendMessage,
    onFileUpload: handleFileUpload,
    placeholder: disabled && stringSet.MESSAGE_INPUT__PLACE_HOLDER__DISABLED // add disabled because of muted state

  }));
};

var OpenChannelInput = /*#__PURE__*/React__default["default"].forwardRef(MessageInputWrapper);

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