1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { withTranslation } from 'react-i18next';
5 import List from '../results/List';
6 import ReportButton from '../results/ReportButton';
7 import { isParticipant } from '../../helpers/permissions';
8 import { findParticipant } from '../../helpers/Tournament';
9 import { withUser } from '../../helpers/UserContext';
10 import i18n from '../../i18n';
17 <li className="round d-flex">
18 <div className="info">
19 <p className="date">{i18n.t('rounds.date', { date: new Date(round.created_at) })}</p>
20 {isParticipant(user, tournament) ?
22 participant={findParticipant(tournament, user)}
24 tournament={tournament}
28 <List round={round} tournament={tournament} />
32 round: PropTypes.shape({
33 created_at: PropTypes.string,
35 tournament: PropTypes.shape({
36 participants: PropTypes.arrayOf(PropTypes.shape({
39 user: PropTypes.shape({
43 export default withTranslation()(withUser(Item));