'use strict';

var React = require('react');
var LocalizationContext = require('../../LocalizationContext-2f07a939.js');
var ui_MessageInput = require('../../ui/MessageInput.js');
var OpenChannel_context = require('../../OpenChannelProvider-e8821f43.js');
require('../../stringSet-70ad7caf.js');
require('../../index-3a44ff71.js');
require('../../_rollupPluginBabelHelpers-325fff35.js');
require('prop-types');
require('../../const-20a4c9f8.js');
require('../../const-94a43f2e.js');
require('../../ui/IconButton.js');
require('../../tslib.es6-6bb94011.js');
require('../../ui/Button.js');
require('../../index-3b8eefa2.js');
require('dompurify');
require('../../consts-dae31183.js');
require('../../ui/Icon.js');
require('../../index-9cb4a8a1.js');
require('../../utils/message/getOutgoingMessageState.js');
require('../../index-e6b1d2b7.js');
require('../../UserProfileContext-5fbd0305.js');
require('../../compareIds-61f98cac.js');
require('../../topics-a17b8ec5.js');
require('@sendbird/chat');
require('@sendbird/chat/openChannel');
require('../../uuid-7d07ac3f.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
