From 9d9f0f2f324868aaf4a36cf4beb0465ad3ce6437 Mon Sep 17 00:00:00 2001 From: Leo dev Date: Sat, 7 Feb 2026 19:17:55 +0100 Subject: [PATCH] Rank --- src/app/run/components/ProfileCard.tsx | 36 ++++++++++++++++++++++++++ src/components/app/Rank.tsx | 29 +++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 src/app/run/components/ProfileCard.tsx create mode 100644 src/components/app/Rank.tsx diff --git a/src/app/run/components/ProfileCard.tsx b/src/app/run/components/ProfileCard.tsx new file mode 100644 index 0000000..d8a6f42 --- /dev/null +++ b/src/app/run/components/ProfileCard.tsx @@ -0,0 +1,36 @@ +import Rank from "@/components/app/Rank"; +import { Badge } from "@/components/ui/badge"; +import { Card, CardContent } from "@/components/ui/card"; + +export default function ProfileCard({ + user, +}: { + user: { username: string; rank: number }; +}) { + return ( + +
+ + + {/* Avatar */} +
+ Img + +
+ +
+
+ + {/* User Info */} +
+

{user.username}

+ WR Holder +
+
+ + ); +} diff --git a/src/components/app/Rank.tsx b/src/components/app/Rank.tsx new file mode 100644 index 0000000..0727cad --- /dev/null +++ b/src/components/app/Rank.tsx @@ -0,0 +1,29 @@ +import { Trophy } from "lucide-react"; + +export default function Rank({ rank }: { rank: number }) { + const getRankStyle = (rank: number) => { + if (rank === 1) return "rank-gold"; + if (rank === 2) return "rank-silver"; + if (rank === 3) return "rank-bronze"; + return "bg-secondary text-muted-foreground"; + }; + + const getRankGlow = (rank: number) => { + if (rank === 1) return "glow-gold"; + if (rank === 2) return "glow-silver"; + if (rank === 3) return "glow-bronze"; + return ""; + }; + + const isTopThree = rank <= 3; + + return ( +
+ {isTopThree ? : rank} +
+ ); +}