{"size": 2090, "ext": "js", "max_stars_repo_path": "src/Components/Scoreboard.js", "max_stars_repo_name": "Brammz/csgo-demo-visualizer", "max_stars_repo_stars_event_min_datetime": "2018-08-27T10:42:47.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-22T15:05:11.000Z", "max_issues_repo_path": "src/Components/Scoreboard.js", "max_issues_repo_name": "Brammz/csgo-demo-visualizer", "max_issues_repo_issues_event_min_datetime": "2018-07-31T07:42:40.000Z", "max_issues_repo_issues_event_max_datetime": "2018-08-28T06:57:41.000Z", "max_forks_repo_path": "src/Components/Scoreboard.js", "max_forks_repo_name": "Brammz/csgo-demo-visualizer", "max_forks_repo_forks_event_min_datetime": "2018-06-03T02:02:09.000Z", "max_forks_repo_forks_event_max_datetime": "2021-02-04T14:19:50.000Z"}
{"max_stars_count": 10, "max_issues_count": 1, "max_forks_count": 3, "avg_line_length": 28.2432432432, "max_line_length": 107, "alphanum_fraction": 0.5062200957}
import React, { Component } from 'react';
import CircularProgressbar from 'react-circular-progressbar';
import '../css/circular-progressbar.css';

class Scoreboard extends Component {

  render() {
    let terrorists = this.props.scores['terrorists'];
    let cts = this.props.scores['cts'];
    let terroristScores = [];
    let ctScores = [];

    for (let t of terrorists.players) {
      terroristScores.push(
        <div key={t.name} className="player">
          <div className="TC1 left-text">
            <br />
            ${t.account}
          </div>
          <div className="TC2 middle-text" title="K / A / D">
            <strong>{t.name}</strong><br/>
            {t.kills} / {t.assists} / {t.deaths}
          </div>
          <div className="TC3">
            <div className="right-float" style={{width: '50%', 'marginTop': '7px'}} title="Headshot Ratio">
              <CircularProgressbar percentage={t.hsPercentage} strokeWidth="10" />
            </div>
          </div>
        </div>
      );
    }

    for (let ct of cts.players) {
      ctScores.push(
        <div key={ct.name} className="player">
          <div className="TC3">
            <div className="left-float" style={{width: '50%', 'marginTop': '7px'}} title="Headshot Ratio">
              <CircularProgressbar percentage={ct.hsPercentage} strokeWidth="10" />
            </div>
          </div>
          <div className="TC2 middle-text" title="K / A / D">
            <strong>{ct.name}</strong><br/>
            {ct.kills} / {ct.assists} / {ct.deaths}
          </div>
          <div className="TC1 right-text">
            <br />
            ${ct.account}
          </div>
        </div>
      );
    }

    return (
      <div id="scoreboard">
        <div id="team1">
          <div className="teamName">
            {terrorists.teamName}
          </div>
          {terroristScores}
        </div>
        <div id="team2">
          <div className="teamName">
            {cts.teamName}
          </div>
          {ctScores}
        </div>
      </div>
    );
  }

}

export default Scoreboard;
