<commit_before>import * as React from 'react';

class TurnDisplay extends React.Component <any, any> {

  constructor(props) {
    super(props);
    this.state = {
      time: 0
    };
  }
  private _countDown() {
    const time: Number = Math.floor((this.props.expiration - Date.now()) / 1000);
    this.setState({time});
    // FIXME: this doesn't seem to be counting down
    console.log('setting new state', time, this.state.counting);
    this.setState({timeout: setTimeout(this._countDown, 500)});
  }

  componentDidMount() {
    this._countDown();
  }

  componentWillUnmount() {
    clearTimeout(this.state.timeout);
  };

  render() {
    return (
      <div className='turnDisplay'>
        <p>Turn #{this.props.turnNum} <span>Time Left: {this.state.time}</span></p>
        <p>{ this.props.prompt }</p>
        {this.props.votes.map(choice => (
          <div><span className='choice'>{choice.name}</span><span className='count'> {choice.count}</span></div>))
        }
      </div>
    );
  }

}
export default TurnDisplay;<commit_msg>fix (chat) suppress error message from not finding a prop<commit_after>import * as React from 'react';

class TurnDisplay extends React.Component<any, any> {

  constructor(props) {
    super(props);
    console.log('turn display props', props);
    this.state = {
      time: 0
    };
  }
  private _countDown() {
    const time: Number = Math.floor((this.props.expiration - Date.now()) / 1000);
    this.setState({ time });
    // FIXME: this doesn't seem to be counting down
    console.log('setting new state', time, this.state.counting);
    this.setState({ timeout: setTimeout(this._countDown, 500) });
  }

  componentDidMount() {
    //this._countDown();
  }

  componentWillUnmount() {
    clearTimeout(this.state.timeout);
  };

  render() {
    return (
      <div className='turnDisplay'>
        <p>Turn #{this.props.turnNum} <span>Time Left: {this.state.time}</span></p>
        <p>{this.props.prompt}</p>
        {this.props.votes.map(choice => (
          <div id={choice.name}><span className='choice'>{choice.name}</span><span className='count'> {choice.count}</span></div>))
        }
      </div>
    );
  }

}
export default TurnDisplay;
{'fraction_non_alphanumeric': 0.1672710788757933, 'fraction_numerical': 0.007252946509519492, 'mean_word_length': 3.042124542124542, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 35, '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': '655983', 'n_tokens_mistral': 714, 'n_tokens_neox': 692, 'n_words': 144}