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 {!round.locked && 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 locked: PropTypes.bool,
55 number: PropTypes.number,
56 seed: PropTypes.string,
58 tournament: PropTypes.shape({
59 participants: PropTypes.arrayOf(PropTypes.shape({
62 user: PropTypes.shape({
66 export default withTranslation()(withUser(Item));