This commit is contained in:
@ -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>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user