add average pp stat
All checks were successful
deploy / deploy (push) Successful in 58s

This commit is contained in:
Lee
2023-10-22 05:34:08 +01:00
parent 58ddf3d79a
commit 154eec2aac
2 changed files with 34 additions and 1 deletions

View File

@ -2,7 +2,11 @@ import { ScoresaberPlayer } from "@/schemas/scoresaber/player";
import { usePlayerScoresStore } from "@/store/playerScoresStore";
import { useSettingsStore } from "@/store/settingsStore";
import { formatNumber } from "@/utils/number";
import { calcPpBoundary, getHighestPpPlay } from "@/utils/scoresaber/scores";
import {
calcPpBoundary,
getAveragePp,
getHighestPpPlay,
} from "@/utils/scoresaber/scores";
import {
GlobeAsiaAustraliaIcon,
HomeIcon,
@ -179,6 +183,14 @@ export default function PlayerInfo({ playerData }: PlayerInfoProps) {
getHighestPpPlay(playerId)?.toFixed(2),
)}pp`}
/>
<Label
title="Avg PP"
className="bg-[#8992e8]"
hoverValue="Average amount of pp per play (best 20 scores)"
value={`${formatNumber(
getAveragePp(playerId)?.toFixed(2),
)}pp`}
/>
<Label
title="+ 1pp"
className="bg-[#8992e8]"