'use strict';

var React = require('react');
var LocalizationContext = require('../../LocalizationContext-caedb682.js');
var ui_MessageInput = require('../../ui/MessageInput.js');
var OpenChannel_context = require('../../OpenChannelProvider-ee813f9e.js');
require('../../stringSet-af541fde.js');
require('../../index-e01cd4a9.js');
require('../../_rollupPluginBabelHelpers-41d3db2d.js');
require('react-dom/server');
require('prop-types');
require('../../const-4ba60f84.js');
require('../../const-4235b5b5.js');
require('../../ui/IconButton.js');
require('../../tslib.es6-f1d22d7f.js');
require('../../ui/Button.js');
require('../../index-06816ee5.js');
require('../../ui/MentionUserLabel.js');
require('../../ui/Icon.js');
require('../../index-476f089f.js');
require('../../utils/message/getOutgoingMessageState.js');
require('../../index-942c3f15.js');
require('../../UserProfileContext-80409a4d.js');
require('../../compareIds-caa9f926.js');
require('../../topics-33f5f434.js');
require('@sendbird/chat');
require('@sendbird/chat/openChannel');
require('../../uuid-2c11c530.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
