1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { Table } from 'react-bootstrap';
4 import { withTranslation } from 'react-i18next';
6 import Box from '../users/Box';
7 import { calculateScores } from '../../helpers/Tournament';
8 import i18n from '../../i18n';
10 const Scoreboard = ({ tournament }) =>
11 <Table striped className="scoreboard">
14 <th>{i18n.t('participants.participant')}</th>
15 <th className="text-end">{i18n.t('participants.score')}</th>
19 {calculateScores(tournament).map(score =>
20 <tr className="score" key={score.participant.id}>
21 <td><Box user={score.participant.user} /></td>
22 <td className="text-end text-lg">{score.score}</td>
28 Scoreboard.propTypes = {
29 tournament: PropTypes.shape({
33 export default withTranslation()(Scoreboard);