'use strict';

var React = require('react');
var LocalizationContext = require('../../LocalizationContext-da62a103.js');
var ui_MessageInput = require('../../ui/MessageInput.js');
var OpenChannel_context = require('../../OpenChannelProvider-bc8d7f0d.js');
require('../../stringSet-857a128c.js');
require('../../index-25336220.js');
require('../../_rollupPluginBabelHelpers-4265e501.js');
require('prop-types');
require('../../const-8a9ec74c.js');
require('../../const-c1a4604d.js');
require('../../ui/IconButton.js');
require('../../tslib.es6-ba69891c.js');
require('../../index-05692021.js');
require('../../index-089e0fba.js');
require('../../ui/MentionUserLabel.js');
require('../../ui/Icon.js');
require('../../index-06c3dca9.js');
require('../../index-f5cb5c7f.js');
require('../../UserProfileContext-891590a7.js');
require('../../compareIds-26079db4.js');
require('../../topics-a755c9c6.js');
require('../../sendbird-dfd051c8.js');
require('../../__bundle-6316ce22-c06e03fc.js');
require('../../__bundle-fbda47dd-1a2c2d97.js');
require('../../openChannel-76345cfa.js');
require('../../__bundle-7dfccc8c-dcc1c854.js');
require('../../uuid-49679ac2.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
