<commit_before>import React, {Component} from 'react'

export default class InputSection extends Component {
  constructor() {
    super();
    this.state = {
      currentMessage: '',
      disabled: true,
    }
    this.handleChange = this.handleChange.bind(this);
    this.submit = this.submit.bind(this);
  }

  handleChange(e){
    const userInput = e.target.value;
    this.setState({currentMessage: userInput});
  }

  clearInputField() {
    this.setState({ currentMessage: ''});
  }

  submit(e){
    this.props.updateState(this.state.currentMessage)
    this.clearInputField()
  }

  render() {
    return (
      <article>
        <input
          type='text'
          className='userInput'
          placeholder='Message'
          onChange={this.handleChange}
          value={this.state.currentMessage}
        ></input>
        <p>
          {this.state.currentMessage.length}
        </p>
        <button
          disabled={!this.state.currentMessage}
          type='button'
          className='submitButton'
          onClick={this.submit}
          ></button>
      </article>
    )<commit_msg>fix disable at 140 chars<commit_after>import React, {Component} from 'react'

export default class InputSection extends Component {
  constructor() {
    super();
    this.state = {
      currentMessage: '',
      disabled: true,
    }
    this.handleChange = this.handleChange.bind(this);
    this.submit = this.submit.bind(this);
  }

  handleChange(e){
    const userInput = e.target.value;
    this.setState({currentMessage: userInput});
    if(this.state.currentMessage > 140){

    }
  }

  clearInputField() {
    this.setState({ currentMessage: ''});
  }

  submit(e){
    this.props.updateState(this.state.currentMessage)
    this.clearInputField()
  }

  render() {
    return (
      <article>
        <input
          type='text'
          className='userInput'
          placeholder='Message'
          onChange={this.handleChange}
          value={this.state.currentMessage}
        ></input>
        <p>
          {this.state.currentMessage.length}
        </p>
        <button
          disabled={!this.state.currentMessage || this.state.currentMessage.length > 140}
          type='button'
          className='submitButton'
          onClick={this.submit}
          ></button>
      </article>
    )
{'fraction_non_alphanumeric': 0.12987569652807543, 'fraction_numerical': 0.0038576939562794685, 'mean_word_length': 2.2643356643356642, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, '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': '6413685', 'n_tokens_mistral': 683, 'n_tokens_neox': 666, 'n_words': 114}