<commit_before>import PropTypes from 'prop-types';
import { length } from 'stringz';

class CharacterCounter extends React.PureComponent {

  checkRemainingText (diff) {
    if (diff <= 0) {
      return <span className='character-counter character-counter--over'>{diff}</span>;
    }
    return <span className='character-counter'>{diff}</span>;
  }

  render () {
    const diff = this.props.max - length(this.props.text);

    return this.checkRemainingText(diff);
  }

}
<commit_msg>Fix character_counter.jsx (#2653)<commit_after>import PropTypes from 'prop-types';
import { length } from 'stringz';

class CharacterCounter extends React.PureComponent {

  checkRemainingText (diff) {
    if (diff < 0) {
      return <span className='character-counter character-counter--over'>{diff}</span>;
    }
    return <span className='character-counter'>{diff}</span>;
  }

  render () {
    const diff = this.props.max - length(this.props.text);

    return this.checkRemainingText(diff);
  }

}

{'fraction_non_alphanumeric': 0.1419939577039275, 'fraction_numerical': 0.006042296072507553, 'mean_word_length': 3.9207920792079207, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, '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': '1894591', 'n_tokens_mistral': 308, 'n_tokens_neox': 297, 'n_words': 64}