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 Protocol from '../protocol/Protocol';
8 import Rounds from '../rounds/List';
12 } from '../../helpers/permissions';
13 import { withUser } from '../../helpers/UserContext';
14 import i18n from '../../i18n';
21 <div className="d-flex align-items-center justify-content-between">
22 <h1>{tournament.title}</h1>
23 {mayViewProtocol(user, tournament) ?
24 <Protocol id={tournament.id} />
27 <div className="d-flex align-items-center justify-content-between">
28 <h2>{i18n.t('participants.heading')}</h2>
30 {tournament.participants ?
31 <Participants participants={tournament.participants} tournament={tournament} />
33 <div className="d-flex align-items-center justify-content-between">
34 <h2>{i18n.t('rounds.heading')}</h2>
35 {addRound && mayAddRounds(user, tournament) ?
36 <Button onClick={addRound}>
37 {i18n.t('rounds.new')}
42 <Rounds rounds={tournament.rounds} tournament={tournament} />
47 addRound: PropTypes.func,
48 tournament: PropTypes.shape({
50 participants: PropTypes.arrayOf(PropTypes.shape({
52 rounds: PropTypes.arrayOf(PropTypes.shape({
54 title: PropTypes.string,
56 user: PropTypes.shape({
60 export default withTranslation()(withUser(Detail));