'use strict';

var React = require('react');
var LocalizationContext = require('../../LocalizationContext-8cc9717d.js');
var ui_MessageInput = require('../../ui/MessageInput.js');
var OpenChannel_context = require('../../OpenChannelProvider-946e4425.js');
require('../../stringSet-ce782136.js');
require('../../index-d749c4c2.js');
require('../../_rollupPluginBabelHelpers-acf412a3.js');
require('prop-types');
require('../../const-b19292fd.js');
require('../../const-a3e169f4.js');
require('../../ui/IconButton.js');
require('../../ui/Button.js');
require('../../index-35633fb6.js');
require('dompurify');
require('../../consts-d04401ad.js');
require('../../ui/Icon.js');
require('../../useSendbirdStateContext.js');
require('../../withSendbird.js');
require('../../index-a91b85d9.js');
require('../../utils/message/getOutgoingMessageState.js');
require('../../consts-016f07ac.js');
require('../../consts-eb163887.js');
require('../../tokenize-88b021e0.js');
require('../../index.module-e3392caa.js');
require('../../index-3fc4f7d7.js');
require('../../UserProfileContext-d993c96b.js');
require('../../compareIds-784d9a4e.js');
require('../../topics-e24ef339.js');
require('@sendbird/chat');
require('@sendbird/chat/openChannel');
require('../../uuid-1eceb0c8.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,
    amIMuted
  } = OpenChannel_context.useOpenChannelContext();
  const channel = currentOpenChannel;
  const {
    stringSet
  } = React.useContext(LocalizationContext.LocalizationContext);
  const {
    value
  } = props;
  function getPlaceHolderString() {
    if (amIMuted) {
      return stringSet.MESSAGE_INPUT__PLACE_HOLDER__MUTED;
    }
    if (disabled) {
      return stringSet.MESSAGE_INPUT__PLACE_HOLDER__DISABLED;
    }
    return '';
  }
  if (!channel) {
    return null;
  }
  return /*#__PURE__*/React__default["default"].createElement("div", {
    className: "sendbird-openchannel-footer"
  }, /*#__PURE__*/React__default["default"].createElement(ui_MessageInput, {
    channel: currentOpenChannel,
    ref: ref,
    value: value,
    disabled: disabled,
    isVoiceMessageEnabled: false,
    onSendMessage: handleSendMessage,
    onFileUpload: handleFileUpload,
    placeholder: getPlaceHolderString()
  }));
};
var OpenChannelInput = /*#__PURE__*/React__default["default"].forwardRef(MessageInputWrapper);

module.exports = OpenChannelInput;
//# sourceMappingURL=OpenChannelInput.js.map
