'use strict';

var React = require('react');
var LocalizationContext = require('../../LocalizationContext-c5621c61.js');
var ui_MessageInput = require('../../ui/MessageInput.js');
var OpenChannel_context = require('../../OpenChannelProvider-0810253b.js');
require('../../stringSet-a5740c90.js');
require('../../index-43d1b90a.js');
require('../../_rollupPluginBabelHelpers-3efc8c18.js');
require('react-dom/server');
require('prop-types');
require('../../const-bd944def.js');
require('../../const-91723167.js');
require('../../ui/IconButton.js');
require('../../tslib.es6-e8b55af5.js');
require('../../ui/Button.js');
require('../../index-5bd7c9b7.js');
require('../../ui/MentionUserLabel.js');
require('../../ui/Icon.js');
require('../../index-9091da93.js');
require('../../utils/message/getOutgoingMessageState.js');
require('../../index-2b47ddd2.js');
require('../../UserProfileContext-aff2c5f8.js');
require('../../compareIds-6b0c325b.js');
require('../../topics-c7a97b32.js');
require('@sendbird/chat');
require('@sendbird/chat/openChannel');
require('../../uuid-f67dc419.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
