import { ScoresaberLeaderboardInfo } from "@/schemas/scoresaber/leaderboard"; import { ScoresaberScore } from "@/schemas/scoresaber/score"; import { formatNumber } from "@/utils/number"; import { scoresaberDifficultyNumberToName } from "@/utils/songUtils"; import { formatDate, formatTimeAgo } from "@/utils/timeUtils"; import Image from "next/image"; import Link from "next/link"; import ScoreStatLabel from "../player/ScoreStatLabel"; type ScoreProps = { score: ScoresaberScore; player: LeaderboardPlayerInfo; leaderboard: ScoresaberLeaderboardInfo; }; export default function LeaderboardScore({ score, player, leaderboard, }: ScoreProps) { const diffName = scoresaberDifficultyNumberToName( leaderboard.difficulty.difficulty, ); const accuracy = ((score.baseScore / leaderboard.maxScore) * 100).toFixed(2); return (
#{formatNumber(score.rank)}
{formatTimeAgo(score.timeSet)}
{player.name}