import { formatNumber } from "@/lib/formatters" import { getSkywarsLevel } from "@/lib/hypixel/skywars/level" import { getHeadsColor, getPrestigeName, getSkyWarsIcon, getTextColor } from "@/lib/hypixel/skywars/skywars" import { cn } from "@/lib/utils" import GenericProgress from "../../_components/GenericProgress" type SkywarsHeadsProps = { heads: number heads_special: { eww: number yucky: number meh: number decent: number salty: number tasty: number succulent: number sweet: number divine: number heavenly: number } } export function SkywarsHeads({ heads, heads_special }: SkywarsHeadsProps) { const total_special = Object.values(heads_special).reduce((a, b) => a + b) const percentages = { heavenly: heads_special.heavenly / heads, divine: heads_special.divine / heads, sweet: heads_special.sweet / heads, succulent: heads_special.succulent / heads, tasty: heads_special.tasty / heads, salty: heads_special.salty / heads, decent: heads_special.decent / heads, meh: heads_special.meh / heads, yucky: heads_special.yucky / heads, eww: heads_special.eww / heads, rest: (heads - total_special) / heads } const headsArray = Object.entries(percentages) return (

{"Total Heads Gathered: "} {formatNumber(heads)}

{total_special > 0 && (
{headsArray.map(([key, val], index) => { const color = getHeadsColor(key) return (
) })}
)}
) } export function AngelOfDeath( { shards, lifetime_shards, opals, lifetime_opals }: { shards: number, lifetime_shards: number, opals: number, lifetime_opals: number } ) { return (

{"Shards: "} {shards}

{"Opals: "} {opals}

{"Lifetime Shards: "} {formatNumber(lifetime_shards)}

{"Lifetime Opals: "} {lifetime_opals}

) } export function ShardProgress({ percent }: { percent: number }) { return (

Shard Progress

) } export function SkywarsLevel({ xp, icon }: { xp: number, icon: string | undefined }) { const level = getSkywarsLevel(xp) const colors = getTextColor(Math.floor(level)) const swIcon = getSkyWarsIcon(icon) const val = `${Math.floor(level)}${swIcon}` if (level > 150) { return (

[ {`${val}`} ]

) } if (level === 50) {

[ {`${val}`} ]

} return (

[ {val} ]

) } export function SkywarsProgress({ level, percent }: { level: number, percent: number }) { return (
) } function LevelNumber({ level, className }: { level: number, className?: string }) { if (level > 150 || level === 50) { return (
150 ? "font-bold" : undefined, className)} style={{ backgroundImage: "linear-gradient(to left,#a0a,#f5f,#5ff,#5f5,#ff5,#fa0,#f55)", WebkitBackgroundClip: "text", color: "transparent" }} > {level}
) } return
{level}
} function Progress({ level, percent }: { level: number, percent: number }) { if (level > 150 || level === 50) { return } return } export function SkywarsPrestige({ level, icon }: { level: number, icon?: string }) { const swIcon = getSkyWarsIcon(icon) const pres = getPrestigeName(level) const val = `${pres} ${swIcon}` if (level > 150 || level === 50) { return ( 150 ? "font-bold" : undefined} > {val} ) } return ( {val} ) }