import { ScoresaberLeaderboardInfo } from "@/schemas/scoresaber/leaderboard"; import { ScoresaberPlayer } from "@/schemas/scoresaber/player"; import { ScoresaberScore } from "@/schemas/scoresaber/score"; import { formatNumber } from "@/utils/number"; import { CheckIcon, GlobeAsiaAustraliaIcon, XMarkIcon, } from "@heroicons/react/20/solid"; import clsx from "clsx"; import moment from "moment"; 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}

{moment(score.timeSet).fromNow()}

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

{leaderboard.songName}

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

{/* Score rank */}

#{score.rank}

{/* Time Set (Mobile) */}
{" "}

{moment(score.timeSet).fromNow()}

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