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