X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Fresults%2FItem.js;h=43ea91d09ca73157d299c9fa3a51075a17e145c9;hb=812a270c7a410461e931394496512d36b34ef7b5;hp=5cdd3be42751c1b678508a1e3800a065b080bf93;hpb=06fd14404164904304a20e2280037e83299247fa;p=alttp.git diff --git a/resources/js/components/results/Item.js b/resources/js/components/results/Item.js index 5cdd3be..43ea91d 100644 --- a/resources/js/components/results/Item.js +++ b/resources/js/components/results/Item.js @@ -9,7 +9,27 @@ import { findResult } from '../../helpers/Participant'; import { maySeeResults } from '../../helpers/permissions'; import { withUser } from '../../helpers/UserContext'; +const getIcon = (result, index) => { + if (!result || !result.has_finished) { + return ; + } + if (result.forfeit) { + return ; + } + if (index === 0) { + return ; + } + if (index === 1) { + return ; + } + if (index === 2) { + return ; + } + return ; +}; + const Item = ({ + index, participant, round, tournament, @@ -25,17 +45,14 @@ const Item = ({ formatTime(result) : null} - {result && result.has_finished ? - - : - - } + {getIcon(result, index)} ); }; Item.propTypes = { + index: PropTypes.number, participant: PropTypes.shape({ user: PropTypes.shape({ }),