<commit_before>var React = require('react');
var PropTypes = React.PropTypes;

function puke (obj) {
  return <pre>{ JSON.stringify(obj, 2, ' ')}</pre>
}

function Results (props) {
  return (
    <div> Results {puke(props)} </div>
  )
}

Results.propTypes = {
  isLoading: PropTypes.bool.isRequired,<commit_msg>Complete Results component<commit_after>var React = require('react');
var PropTypes = React.PropTypes;
var styles = require('../styles');
var UserDetails = require('./UserDetails');
var UserDetailsWrapper = require('./UserDetailsWrapper');
var Link = require('react-router').Link;

function StartOver (){
  return (
    <div className="col-sm-12" styles={styles.space}>
      <Link to="/playerOne">
        <button type="button" className="btn btn-lg btn-danger">Start Over</button>
      </Link>
    </div>
  )
}

function Results (props) {
  if (props.isLoading === true) {
    return (
      <p> LOADING </p>
    )
  }

  if (props.scores[0] === props.scores[1]){
    return (
      <div className="jumbotron col-sm-12 text-center" style={styles.transparentBg}>
        <h1>It's a tie!</h1>
        <StartOver />
      </div>
    )
  }
  var winningIndex = props.scores[0] > props.scores[1] ? 0 : 1;
  var loosingIndex = winningIndex === 0 ? 1 : 0;
  return (
    <div className="jumbotron col-sm-12 text-center" style={styles.transparentBg}>
      <h1>Results</h1>
      <div className="col-sm-8 col-sm-offset-2">
        <UserDetailsWrapper header="Winner">
          <UserDetails score={props.scores[winningIndex]} info={props.playersInfo[winningIndex]}/>
        </UserDetailsWrapper>
        <UserDetailsWrapper header="Looser">
          <UserDetails score={props.scores[loosingIndex]} info={props.playersInfo[loosingIndex]}/>
        </UserDetailsWrapper>
      </div>
      <StartOver />
    </div>
  )
}

Results.propTypes = {
  isLoading: PropTypes.bool.isRequired,
{'fraction_non_alphanumeric': 0.16243386243386243, 'fraction_numerical': 0.01164021164021164, 'mean_word_length': 3.3371559633027523, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 34, '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': '2003182', 'n_tokens_mistral': 627, 'n_tokens_neox': 610, 'n_words': 124}