'use strict';

var React = require('react');
var LocalizationContext = require('../../LocalizationContext-1f00818c.js');
var ui_MessageInput = require('../../ui/MessageInput.js');
var OpenChannel_context = require('../../OpenChannelProvider-dd8403ee.js');
require('../../stringSet-410775ff.js');
require('../../index-d82f6dd1.js');
require('../../_rollupPluginBabelHelpers-6917423d.js');
require('react-dom/server');
require('prop-types');
require('../../const-bf239fc5.js');
require('../../const-67a2a885.js');
require('../../ui/IconButton.js');
require('../../tslib.es6-7d75f2e2.js');
require('../../ui/Button.js');
require('../../index-8d7a94e3.js');
require('../../ui/MentionUserLabel.js');
require('../../ui/Icon.js');
require('../../index-177380fc.js');
require('../../index-a11fb495.js');
require('../../UserProfileContext-3a4f0132.js');
require('../../compareIds-8d064912.js');
require('../../topics-9747398e.js');
require('../../sendbird-5edd0213.js');
require('../../__bundle-57e0c5af-b8304f7a.js');
require('../../__bundle-0dad34cd-bd827f82.js');
require('../../openChannel-c5952dd7.js');
require('../../__bundle-bd072f34-578ccb1e.js');
require('../../uuid-c813a8a1.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 (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;
  var value = props.value;
  return /*#__PURE__*/React__default["default"].createElement("div", {
    className: "sendbird-openchannel-footer"
  }, /*#__PURE__*/React__default["default"].createElement(ui_MessageInput, {
    ref: ref,
    value: value,
    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
