1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { withTranslation } from 'react-i18next';
5 import LockButton from './LockButton';
6 import SeedButton from './SeedButton';
7 import SeedCode from './SeedCode';
8 import List from '../results/List';
9 import ReportButton from '../results/ReportButton';
10 import { isParticipant } from '../../helpers/permissions';
11 import { findParticipant } from '../../helpers/Tournament';
12 import { withUser } from '../../helpers/UserContext';
13 import i18n from '../../i18n';
20 <li className="round d-flex">
21 <div className="info">
23 {round.number ? `#${round.number} ` : '#?'}
24 {i18n.t('rounds.date', { date: new Date(round.created_at) })}
29 <SeedCode code={round.code} />
35 tournament={tournament}
38 {!round.locked && isParticipant(user, tournament) ?
39 <p className="report">
41 participant={findParticipant(tournament, user)}
43 tournament={tournament}
47 <LockButton round={round} tournament={tournament} />
49 <List round={round} tournament={tournament} />
53 round: PropTypes.shape({
54 code: PropTypes.arrayOf(PropTypes.string),
55 created_at: PropTypes.string,
56 locked: PropTypes.bool,
57 number: PropTypes.number,
58 seed: PropTypes.string,
60 tournament: PropTypes.shape({
61 participants: PropTypes.arrayOf(PropTypes.shape({
64 user: PropTypes.shape({
68 export default withTranslation()(withUser(Item));