<commit_before>import React, { Component } from 'react'
import firebase, { reference, signIn } from '../firebase';

export default class Input extends Component {
  constructor(){
    super();
    this.state = {
      message: '',
    }
  }

  handleSubmit() {
    this.props.sendMessage(this.state)
    this.clearInput();
  }

  updateMessage(e) {
    const message = e.target.value
    this.setState({ message: message })
  }

  handleKeyUp(e) {
    if (e.keyCode === 13) {
      this.handleSubmit();
    }
  }

  clearInput() {
    this.setState({ message: '' })
  }

  charCount() {
    let count = 140 - this.state.message.length;
    if (count < 0) {
      return <div className='charCountRed'>{count}</div>
    } else {<commit_msg>Add line to enter key functionality<commit_after>import React, { Component } from 'react'
import firebase, { reference, signIn } from '../firebase';

export default class Input extends Component {
  constructor(){
    super();
    this.state = {
      message: '',
    }
  }

  handleSubmit() {
    this.props.sendMessage(this.state)
    this.clearInput();
  }

  updateMessage(e) {
    const message = e.target.value
    this.setState({ message: message })
  }

  handleKeyUp(e) {
    if (e.keyCode === 13 && this.state.message.length <= 140) {
      this.handleSubmit();
    }
  }

  clearInput() {
    this.setState({ message: '' })
  }

  charCount() {
    let count = 140 - this.state.message.length;
    if (count < 0) {
      return <div className='charCountRed'>{count}</div>
    } else {
{'fraction_non_alphanumeric': 0.15189048239895697, 'fraction_numerical': 0.009778357235984355, 'mean_word_length': 2.734793187347932, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6402189', 'n_tokens_mistral': 507, 'n_tokens_neox': 485, 'n_words': 109}