import { ScoresaberLeaderboardInfo } from "@/schemas/scoresaber/leaderboard"; import { ScoresaberPlayer } from "@/schemas/scoresaber/player"; import { ScoresaberScore } from "@/schemas/scoresaber/score"; import { formatNumber } from "@/utils/number"; import { formatDate, formatTimeAgo } from "@/utils/timeUtils"; import { CheckIcon, GlobeAsiaAustraliaIcon, XMarkIcon, } from "@heroicons/react/20/solid"; import clsx from "clsx"; import Image from "next/image"; import ScoreStatLabel from "./ScoreStatLabel"; type ScoreProps = { score: ScoresaberScore; player: ScoresaberPlayer; leaderboard: ScoresaberLeaderboardInfo; }; export default function Score({ score, player, leaderboard }: ScoreProps) { const isFullCombo = score.missedNotes + score.badCuts === 0; return (

#{score.rank}

{formatTimeAgo(score.timeSet)}

{/* Song Image */}
{leaderboard.songName} {/* Song Info */}

{leaderboard.songName}

{leaderboard.songAuthorName}{" "} {leaderboard.levelAuthorName}

{/* Score rank */}

#{score.rank}

{/* Time Set (Mobile) */}

{formatTimeAgo(score.timeSet)}

{/* PP */}
{score.pp > 0 && ( )} {/* Percentage score */}
{/* Missed Notes */} ) : ( ) } value={ isFullCombo ? "FC" : formatNumber(score.missedNotes + score.badCuts) + "x" } />
); }