<commit_before>import React, { Component } from 'react';
import Immutable from 'immutable';
import { Button, Panel, Table, Label } from 'react-bootstrap';
import Gravatar from 'react-gravatar';
import moment from 'moment';
import RecordIndicator from './RecordIndicator';
import InvitePlayerModalContainer from '../containers/InvitePlayerModalContainer';

export default class LeagueDetail extends Component {
  render() {
    return (
      <div>
        { this._getPlayersTable() }
        <InvitePlayerModalContainer league={ this.props.league } />
      </div>
    );
  }

  _getPlayersTable() {
    if (this.props.isLoading) {
      return <div>Loading...</div>;
    }

    const header = (
      <div>
        { this.props.league.get('name') }
        { this._getInvitePlayerButton() }
      </div>
    );

    return (
      <Panel header={ header }>
        <Table className="player-table">
          <thead>
            <tr>
              <th className="text-center">Rank</th>
              <th>Player</th>
              <th className="text-center">Rating</th>
              <th>Record</th>
              <th className="text-center">Win %</th>
              <th className="text-center">Streak</th>
              <th className="text-center">Last Played</th>
            </tr>
          </thead>
          <tbody>
            { this._getPlayerRows() }
          </tbody>
        </Table>
      </Panel>
    );
  }

  _getInvitePlayerButton() {
    return (
      <Button
        bsSize="xsmall"
        bsStyle="success"
        className="invite-player-button"
        onClick={ this.props.showInvitePlayerModal }>
        Invite New Player
      </Button>
    );
  }

  _getPlayerRows() {
    return this.props.league.get('players')
              .sortBy((member) => member.getIn(['player', 'elo']))
              .reverse()
              .map((member, index) => {
                const player = member.get('player');
                const lastPlayed = moment(member.get('lastPlayed')).format('MM-DD-YYYY');
                const wins = player.get('wins');
                const losses = player.get('losses');
                const winPercentage = Math.floor((wins / (wins + losses)) * 100) || 0;
                const streak = player.get('streak');
                const streakClass = streak > 0 ? 'info' : (streak < 0 ? 'danger' : '');
<commit_msg>set style to default for new player streaks<commit_after>import React, { Component } from 'react';
import Immutable from 'immutable';
import { Button, Panel, Table, Label } from 'react-bootstrap';
import Gravatar from 'react-gravatar';
import moment from 'moment';
import RecordIndicator from './RecordIndicator';
import InvitePlayerModalContainer from '../containers/InvitePlayerModalContainer';

export default class LeagueDetail extends Component {
  render() {
    return (
      <div>
        { this._getPlayersTable() }
        <InvitePlayerModalContainer league={ this.props.league } />
      </div>
    );
  }

  _getPlayersTable() {
    if (this.props.isLoading) {
      return <div>Loading...</div>;
    }

    const header = (
      <div>
        { this.props.league.get('name') }
        { this._getInvitePlayerButton() }
      </div>
    );

    return (
      <Panel header={ header }>
        <Table className="player-table">
          <thead>
            <tr>
              <th className="text-center">Rank</th>
              <th>Player</th>
              <th className="text-center">Rating</th>
              <th>Record</th>
              <th className="text-center">Win %</th>
              <th className="text-center">Streak</th>
              <th className="text-center">Last Played</th>
            </tr>
          </thead>
          <tbody>
            { this._getPlayerRows() }
          </tbody>
        </Table>
      </Panel>
    );
  }

  _getInvitePlayerButton() {
    return (
      <Button
        bsSize="xsmall"
        bsStyle="success"
        className="invite-player-button"
        onClick={ this.props.showInvitePlayerModal }>
        Invite New Player
      </Button>
    );
  }

  _getPlayerRows() {
    return this.props.league.get('players')
              .sortBy((member) => member.getIn(['player', 'elo']))
              .reverse()
              .map((member, index) => {
                const player = member.get('player');
                const lastPlayed = moment(member.get('lastPlayed')).format('MM-DD-YYYY');
                const wins = player.get('wins');
                const losses = player.get('losses');
                const winPercentage = Math.floor((wins / (wins + losses)) * 100) || 0;
                const streak = player.get('streak');
                const streakClass = streak > 0 ? 'info' : (streak < 0 ? 'danger' : 'default');

{'fraction_non_alphanumeric': 0.14468980021030495, 'fraction_numerical': 0.002523659305993691, 'mean_word_length': 1.9874371859296482, 'pattern_counts': {'":': 0, '<': 71, '<?xml version=': 0, '>': 75, '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': '2210407', 'n_tokens_mistral': 1388, 'n_tokens_neox': 1341, 'n_words': 282}