'use strict';

var React = require('react');
var LocalizationContext = require('../../LocalizationContext-1f669b3c.js');
var ui_MessageInput = require('../../ui/MessageInput.js');
var OpenChannel_context = require('../../OpenChannelProvider-1e578c60.js');
require('../../stringSet-ddd351f0.js');
require('../../index-f5502150.js');
require('../../_rollupPluginBabelHelpers-32557b21.js');
require('react-dom/server');
require('prop-types');
require('../../const-fe838b59.js');
require('../../const-77194948.js');
require('../../ui/IconButton.js');
require('../../tslib.es6-d2ba1a6b.js');
require('../../ui/Button.js');
require('../../index-1b11bb85.js');
require('../../ui/MentionUserLabel.js');
require('../../ui/Icon.js');
require('../../index-b32fce67.js');
require('../../utils/message/getOutgoingMessageState.js');
require('dompurify');
require('../../index-81e19961.js');
require('../../UserProfileContext-cde95db8.js');
require('../../compareIds-32f97a73.js');
require('../../topics-5edbb1b2.js');
require('@sendbird/chat');
require('@sendbird/chat/openChannel');
require('../../uuid-28e4a814.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
