<commit_before>import React from 'react'

import style from './style.scss'

export default class Typing extends React.Component {
  constructor() {
    super()

    this.state = {
      message: ''
    }
  }

  handleChange = (event) => {
    this.setState({
      message: event.target.value
    })
  }

  handleKeyPress = (event) => {
    if (event.key === 'Enter' && this.state.message) {
      this.props.sendMessage(this.state.message)
      event.preventDefault()
      this.setState({
        message: ''
      })
      return false
    }
  }

  render() {
    return (
      <div className={style.typing}>
        <textarea value={this.state.message} onChange={this.handleChange} onKeyPress={this.handleKeyPress} />
      </div>
    )
  }
}<commit_msg>fix(hitl): added trim in hitl textarea<commit_after>import React from 'react'

import style from './style.scss'

export default class Typing extends React.Component {
  constructor() {
    super()

    this.state = {
      message: ''
    }
  }

  handleChange = event => {
    this.setState({
      message: event.target.value
    })
  }

  handleKeyPress = event => {
    if (this.state.message) {
      const message = this.state.message.trim()

      if (event.key === 'Enter' && message.length > 0) {
        this.props.sendMessage(message)
        event.preventDefault()
        this.setState({
          message: ''
        })
        return false
      }
    }
  }

  render() {
    return (
      <div className={style.typing}>
        <textarea value={this.state.message} onChange={this.handleChange} onKeyPress={this.handleKeyPress} />
      </div>
    )
  }
}
{'fraction_non_alphanumeric': 0.14040465971796443, 'fraction_numerical': 0.0006131207847946045, 'mean_word_length': 2.296969696969697, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 14, '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': '6530801', 'n_tokens_mistral': 509, 'n_tokens_neox': 503, 'n_words': 99}