'use strict';

var React = require('react');
var LocalizationContext = require('../../LocalizationContext-af96cf5f.js');
var ui_MessageInput = require('../../ui/MessageInput.js');
var OpenChannel_context = require('../../OpenChannelProvider-ea1d7b37.js');
require('../../stringSet-68748705.js');
require('../../index-83d1d15e.js');
require('../../_rollupPluginBabelHelpers-c5955c81.js');
require('prop-types');
require('../../const-ab0f6056.js');
require('../../const-6691e574.js');
require('../../ui/IconButton.js');
require('../../ui/Button.js');
require('../../index-73643285.js');
require('dompurify');
require('../../consts-6ec77e9a.js');
require('../../ui/Icon.js');
require('../../index-f2146bae.js');
require('../../utils/message/getOutgoingMessageState.js');
require('../../consts-bc27beff.js');
require('../../consts-a422c2f9.js');
require('../../tokenize-d86ab0c7.js');
require('../../index-f65677b1.js');
require('../../UserProfileContext-f068b0ba.js');
require('../../compareIds-18b3b1d6.js');
require('../../topics-825e5d42.js');
require('@sendbird/chat');
require('@sendbird/chat/openChannel');
require('../../uuid-0b4ed44c.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);

const MessageInputWrapper = (props, ref) => {
  const {
    currentOpenChannel,
    disabled,
    handleSendMessage,
    handleFileUpload
  } = OpenChannel_context.useOpenChannelContext();
  const channel = currentOpenChannel;
  if (!channel) {
    return;
  }
  const {
    stringSet
  } = React.useContext(LocalizationContext.LocalizationContext);
  const {
    value
  } = props;
  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
