1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { Button, Container } from 'react-bootstrap';
4 import { withTranslation } from 'react-i18next';
6 import Participants from '../participants/List';
7 import Rounds from '../rounds/List';
8 import { mayAddRounds } from '../../helpers/permissions';
9 import { withUser } from '../../helpers/UserContext';
10 import i18n from '../../i18n';
17 <div className="d-flex align-items-center justify-content-between">
18 <h1>{tournament.title}</h1>
20 <div className="d-flex align-items-center justify-content-between">
21 <h2>{i18n.t('participants.heading')}</h2>
23 {tournament.participants ?
24 <Participants participants={tournament.participants} tournament={tournament} />
26 <div className="d-flex align-items-center justify-content-between">
27 <h2>{i18n.t('rounds.heading')}</h2>
28 {addRound && mayAddRounds(user, tournament) ?
29 <Button onClick={addRound}>
30 {i18n.t('rounds.new')}
35 <Rounds rounds={tournament.rounds} tournament={tournament} />
40 addRound: PropTypes.func,
41 tournament: PropTypes.shape({
42 participants: PropTypes.arrayOf(PropTypes.shape({
44 rounds: PropTypes.arrayOf(PropTypes.shape({
46 title: PropTypes.string,
48 user: PropTypes.shape({
52 export default withTranslation()(withUser(Detail));