1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { Button } from 'react-bootstrap';
4 import { withTranslation } from 'react-i18next';
6 import List from '../results/List';
7 import ReportButton from '../results/ReportButton';
8 import { isParticipant } from '../../helpers/permissions';
9 import { findParticipant } from '../../helpers/Tournament';
10 import { withUser } from '../../helpers/UserContext';
11 import i18n from '../../i18n';
18 <li className="round d-flex">
19 <div className="info">
20 <p className="date">{i18n.t('rounds.date', { date: new Date(round.created_at) })}</p>
23 <Button href={round.seed} target="_blank" variant="primary">
24 {i18n.t('rounds.seed')}
28 {isParticipant(user, tournament) ?
29 <p className="report">
31 participant={findParticipant(tournament, user)}
33 tournament={tournament}
38 <List round={round} tournament={tournament} />
42 round: PropTypes.shape({
43 created_at: PropTypes.string,
44 seed: PropTypes.string,
46 tournament: PropTypes.shape({
47 participants: PropTypes.arrayOf(PropTypes.shape({
50 user: PropTypes.shape({
54 export default withTranslation()(withUser(Item));