import React from 'react'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import { withRoomContext } from '../RoomContext'; const BotMessageRegex = new RegExp('^@bot (.*)'); class ChatInput extends React.Component { constructor(props) { super(props); this.state = { text : '' }; // TextArea element got via React ref. // @type {HTMLElement} this._textareaElem = null; } render() { const { connected, chatDataProducer, botDataProducer } = this.props; const { text } = this.state; const disabled = !connected || (!chatDataProducer && !botDataProducer); return (