X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Fresults%2FItem.js;fp=resources%2Fjs%2Fcomponents%2Fresults%2FItem.js;h=993a3823fd2cfd5a1058b749d67ac1ec81fa4ba8;hb=edd0e97bfdc544114f30bf4c13a929631c44a555;hp=0000000000000000000000000000000000000000;hpb=55f2d7cd6c290a0d26db177d54d20c393f890bbb;p=alttp.git diff --git a/resources/js/components/results/Item.js b/resources/js/components/results/Item.js new file mode 100644 index 0000000..993a382 --- /dev/null +++ b/resources/js/components/results/Item.js @@ -0,0 +1,38 @@ +import PropTypes from 'prop-types'; +import React from 'react'; +import { withTranslation } from 'react-i18next'; + +import Box from '../users/Box'; +import { formatTime } from '../../helpers/Result'; +import { findResult } from '../../helpers/Participant'; +import i18n from '../../i18n'; + +const Item = ({ + participant, + round, +}) => { + const result = findResult(participant, round); + return ( +
+ + {result ? +
+ {i18n.t('results.time', { time: formatTime(result) })} +
+ : null} +
+ ); +}; + +Item.propTypes = { + participant: PropTypes.shape({ + user: PropTypes.shape({ + }), + }), + round: PropTypes.shape({ + }), + tournament: PropTypes.shape({ + }), +}; + +export default withTranslation()(Item);