'use strict';

var React = require('react');
var LocalizationContext = require('../../LocalizationContext-9a1e0d36.js');
var ui_MessageInput = require('../../ui/MessageInput.js');
var OpenChannel_context = require('../../OpenChannelProvider-cdba865d.js');
require('../../stringSet-2696d00d.js');
require('../../index-6ca5c151.js');
require('../../_rollupPluginBabelHelpers-ada5a2bb.js');
require('react-dom/server');
require('prop-types');
require('../../const-5080a6f8.js');
require('../../const-cd2f7184.js');
require('../../ui/IconButton.js');
require('../../tslib.es6-259cb5ca.js');
require('../../ui/Button.js');
require('../../index-d714b895.js');
require('../../ui/MentionUserLabel.js');
require('../../ui/Icon.js');
require('../../index-b5c769e1.js');
require('../../utils/message/getOutgoingMessageState.js');
require('../../index-5bc31321.js');
require('../../UserProfileContext-2648d24c.js');
require('../../compareIds-03d1c5fd.js');
require('../../topics-528fde56.js');
require('@sendbird/chat');
require('@sendbird/chat/openChannel');
require('../../uuid-4e015383.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
