"use client"; import { Award, Trophy } from "lucide-react"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { Card, CardContent } from "@/components/ui/card"; const styles = [ { border: "border-yellow-500/50", bg: "bg-yellow-500/5", height: "h-48", text: "text-yellow-600", }, { border: "border-zinc-400/50", bg: "bg-zinc-400/5", height: "h-36", text: "text-zinc-500", }, { border: "border-amber-700/50", bg: "bg-amber-700/5", height: "h-32", text: "text-amber-700", }, ]; interface TopDonateRow { name: string; amount: number; image?: string; } export function Podium({ data }: { data: TopDonateRow[] }) { // [1,2,3] -> [2,1,3] const order = [data[1], data[0], data[2]].filter(Boolean); return (
{order.map((donor, index) => { const rank = index === 0 ? 1 : index === 1 ? 0 : 2; const s = styles[rank]; const initial = donor.name?.charAt(0).toUpperCase() ?? "?"; return (
{rank === 0 ? ( ) : ( )}
{initial} {donor.name} {donor.amount}฿
); })}
); }