import ScoreSaberPlayer from "@/app/common/leaderboard/types/scoresaber/scoresaber-player"; import { formatNumberWithCommas } from "@/app/common/number-utils"; import { GlobeAmericasIcon } from "@heroicons/react/24/solid"; import CountryFlag from "../country-flag"; import { Avatar, AvatarImage } from "../ui/avatar"; import ClaimProfile from "./claim-profile"; import PlayerSubName from "./player-sub-name"; const playerSubNames = [ { icon: () => { return ; }, render: (player: ScoreSaberPlayer) => { return

#{formatNumberWithCommas(player.rank)}

; }, }, { icon: (player: ScoreSaberPlayer) => { return ; }, render: (player: ScoreSaberPlayer) => { return

#{formatNumberWithCommas(player.countryRank)}

; }, }, { render: (player: ScoreSaberPlayer) => { return

{formatNumberWithCommas(player.pp)}pp

; }, }, ]; type Props = { player: ScoreSaberPlayer; }; export default function PlayerHeader({ player }: Props) { return (

{player.name}

{playerSubNames.map((subName, index) => { return ( {subName.render(player)} ); })}
); }