'use strict';

var React = require('react');
var LocalizationContext = require('../../LocalizationContext-53fd4ae9.js');
var ui_MessageInput = require('../../ui/MessageInput.js');
var OpenChannel_context = require('../../OpenChannelProvider-49f11291.js');
require('../../stringSet-42fa6280.js');
require('../../index-7c018421.js');
require('../../_rollupPluginBabelHelpers-3c8c757e.js');
require('react-dom/server');
require('prop-types');
require('../../const-6d262369.js');
require('../../const-5e034408.js');
require('../../ui/IconButton.js');
require('../../tslib.es6-5163dacf.js');
require('../../ui/Button.js');
require('../../index-db48f031.js');
require('../../ui/MentionUserLabel.js');
require('../../ui/Icon.js');
require('../../index-482bbe89.js');
require('../../utils/message/getOutgoingMessageState.js');
require('../../index-a283267f.js');
require('../../UserProfileContext-c7d6be85.js');
require('../../compareIds-d78964c7.js');
require('../../topics-bc8e923e.js');
require('@sendbird/chat');
require('@sendbird/chat/openChannel');
require('../../uuid-e879709a.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,
    isVoiceMessageEnabled: false,
    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
