1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { withTranslation } from 'react-i18next';
5 import Icon from '../common/Icon';
6 import Box from '../users/Box';
7 import { formatTime } from '../../helpers/Result';
8 import { findResult } from '../../helpers/Participant';
9 import { maySeeResults } from '../../helpers/permissions';
10 import { withUser } from '../../helpers/UserContext';
18 const result = findResult(participant, round);
20 <div className="result">
21 <Box user={participant.user} />
22 <div className="status">
23 <span className="time">
24 {result && maySeeResults(user, tournament, round) ?
28 {result && result.has_finished ?
29 <Icon.FINISHED className="text-success" size="lg" />
31 <Icon.PENDING size="lg" />
39 participant: PropTypes.shape({
40 user: PropTypes.shape({
43 round: PropTypes.shape({
45 tournament: PropTypes.shape({
47 user: PropTypes.shape({
51 export default withTranslation()(withUser(Item));