1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { withTranslation } from 'react-i18next';
5 import SeedButton from './SeedButton';
6 import SeedCode from './SeedCode';
7 import List from '../results/List';
8 import ReportButton from '../results/ReportButton';
9 import { isParticipant } from '../../helpers/permissions';
10 import { findParticipant } from '../../helpers/Tournament';
11 import { withUser } from '../../helpers/UserContext';
12 import i18n from '../../i18n';
19 <li className="round d-flex">
20 <div className="info">
22 {round.number ? `#${round.number} ` : '#?'}
23 {i18n.t('rounds.date', { date: new Date(round.created_at) })}
27 <SeedCode code={round.code} />
31 tournament={tournament}
34 {isParticipant(user, tournament) ?
35 <p className="report">
37 participant={findParticipant(tournament, user)}
39 tournament={tournament}
44 <List round={round} tournament={tournament} />
48 round: PropTypes.shape({
49 code: PropTypes.arrayOf(PropTypes.string),
50 created_at: PropTypes.string,
51 number: PropTypes.number,
52 seed: PropTypes.string,
54 tournament: PropTypes.shape({
55 participants: PropTypes.arrayOf(PropTypes.shape({
58 user: PropTypes.shape({
62 export default withTranslation()(withUser(Item));