1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { Button, Table } from 'react-bootstrap';
4 import { withTranslation } from 'react-i18next';
6 import Icon from '../common/Icon';
7 import Box from '../users/Box';
8 import { calculateScores } from '../../helpers/Tournament';
9 import i18n from '../../i18n';
11 const Scoreboard = ({ tournament }) =>
12 <Table striped className="scoreboard">
15 <th>{i18n.t('participants.participant')}</th>
16 <th className="text-end">{i18n.t('participants.score')}</th>
20 {calculateScores(tournament).map(score =>
21 <tr className="score" key={score.participant.id}>
23 <div className="d-flex align-items-center justify-content-between">
24 <Box user={score.participant.user} />
25 {score.participant.user.stream_link ?
27 href={score.participant.user.stream_link}
30 title={i18n.t('users.stream')}
31 variant="outline-twitch"
33 <Icon.STREAM title="" />
38 <td className="text-end text-lg">{score.score}</td>
44 Scoreboard.propTypes = {
45 tournament: PropTypes.shape({
49 export default withTranslation()(Scoreboard);