'use strict';

var React = require('react');
var LocalizationContext = require('../../LocalizationContext-c0dc9e2f.js');
var ui_MessageInput = require('../../ui/MessageInput.js');
var OpenChannel_context = require('../../OpenChannelProvider-2d921cf0.js');
require('../../stringSet-8a5752c1.js');
require('../../index-897ebaf9.js');
require('../../_rollupPluginBabelHelpers-59502943.js');
require('prop-types');
require('../../const-79c19d9a.js');
require('../../const-cddf6176.js');
require('../../ui/IconButton.js');
require('../../index-f10a973e.js');
require('../../index-5755be7f.js');
require('../../ui/MentionUserLabel.js');
require('../../ui/Icon.js');
require('../../index-54177640.js');
require('../../tslib.es6-999b9d2f.js');
require('../../index-f73b522b.js');
require('../../UserProfileContext-2bd8a987.js');
require('../../compareIds-70f7ec01.js');
require('../../topics-5541d80a.js');
require('../../openChannel-0e621900.js');
require('../../__bundle-7dfccc8c-92c0a42c.js');
require('../../uuid-c1af9ac6.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
