basic score view
Some checks failed
Deploy SSR / deploy (push) Failing after 26s

This commit is contained in:
Lee
2024-09-11 20:10:27 +01:00
parent bc86cae8aa
commit e9f55389f4
15 changed files with 271 additions and 30 deletions

View File

@ -1,4 +1,5 @@
import { scoresaberLeaderboard } from "@/app/common/leaderboard/impl/scoresaber";
import { ScoreSort } from "@/app/common/leaderboard/sort";
import { formatNumberWithCommas } from "@/app/common/number-utils";
import PlayerData from "@/app/components/player/player-data";
import { format } from "@formkit/tempo";
@ -39,8 +40,8 @@ export async function generateMetadata({ params: { slug } }: Props): Promise<Met
export default async function Search({ params: { slug } }: Props) {
const id = slug[0]; // The players id
// const sort: ScoreSort = (slug[1] as ScoreSort) || "recent"; // The sorting method
// const page = slug[2] || 1; // The page number
const sort: ScoreSort = (slug[1] as ScoreSort) || "recent"; // The sorting method
const page = parseInt(slug[2]) || 1; // The page number
const player = await scoresaberLeaderboard.lookupPlayer(id, false);
if (player == undefined) {
@ -50,7 +51,7 @@ export default async function Search({ params: { slug } }: Props) {
return (
<div className="flex flex-col h-full w-full">
<PlayerData initalPlayerData={player} />
<PlayerData initalPlayerData={player} sort={sort} page={page} />
</div>
);
}