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) })}
28 <SeedCode code={round.code} />
34 tournament={tournament}
37 {isParticipant(user, tournament) ?
38 <p className="report">
40 participant={findParticipant(tournament, user)}
42 tournament={tournament}
47 <List round={round} tournament={tournament} />
51 round: PropTypes.shape({
52 code: PropTypes.arrayOf(PropTypes.string),
53 created_at: PropTypes.string,
54 number: PropTypes.number,
55 seed: PropTypes.string,
57 tournament: PropTypes.shape({
58 participants: PropTypes.arrayOf(PropTypes.shape({
61 user: PropTypes.shape({
65 export default withTranslation()(withUser(Item));