1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { Button, Col, Container, Row } from 'react-bootstrap';
4 import { withTranslation } from 'react-i18next';
6 import Scoreboard from './Scoreboard';
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';
20 }) => <Container fluid>
23 <div className="d-flex align-items-center justify-content-between">
24 <h1>{tournament.title}</h1>
25 {mayViewProtocol(user, tournament) ?
26 <Protocol id={tournament.id} />
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} />
46 <div className="d-flex align-items-center justify-content-between">
47 <h2>{i18n.t('tournaments.scoreboard')}</h2>
49 {tournament.participants ?
50 <Scoreboard tournament={tournament} />
57 addRound: PropTypes.func,
58 tournament: PropTypes.shape({
60 participants: PropTypes.arrayOf(PropTypes.shape({
62 rounds: PropTypes.arrayOf(PropTypes.shape({
64 title: PropTypes.string,
66 user: PropTypes.shape({
70 export default withTranslation()(withUser(Detail));