the browser-facing portion of osu!

Remove extra function for PpValue title and content

clayton 6e6ae54b cb6f81ea

+14 -12
+14 -12
resources/js/scores/pp-value.tsx
··· 11 suffix?: React.ReactNode; 12 } 13 14 - export default function PpValue(props: Props) { 15 - const [title, content] = getTitleAndContent(props); 16 - 17 - return <span title={title}>{content}</span>; 18 - } 19 - 20 - function getTitleAndContent({ score, suffix }: Props): [string, React.ReactNode] { 21 if (score.type !== 'solo_score' && score.best_id == null) { 22 - return [trans('scores.status.non_best'), '-']; 23 } 24 25 if ( 26 score.type === 'solo_score' && 27 (!score.preserve || !score.ranked || (score.pp == null && score.processed)) 28 ) { 29 - return [trans('scores.status.no_pp'), '-']; 30 } 31 32 if (score.pp == null) { 33 - // eslint-disable-next-line react/jsx-key 34 - return [trans('scores.status.processing'), <span className='fas fa-sync' />]; 35 } 36 37 - return [formatNumber(score.pp), <>{formatNumber(Math.round(score.pp))}{suffix}</>]; 38 }
··· 11 suffix?: React.ReactNode; 12 } 13 14 + export default function PpValue({ score, suffix }: Props) { 15 if (score.type !== 'solo_score' && score.best_id == null) { 16 + return <span title={trans('scores.status.non_best')}>-</span>; 17 } 18 19 if ( 20 score.type === 'solo_score' && 21 (!score.preserve || !score.ranked || (score.pp == null && score.processed)) 22 ) { 23 + return <span title={trans('scores.status.no_pp')}>-</span>; 24 } 25 26 if (score.pp == null) { 27 + return ( 28 + <span title={trans('scores.status.processing')}> 29 + <span className='fas fa-sync' /> 30 + </span> 31 + ); 32 } 33 34 + return ( 35 + <span title={formatNumber(score.pp)}> 36 + {formatNumber(Math.round(score.pp))} 37 + {suffix} 38 + </span> 39 + ); 40 }