import { ClientDate } from "@/components/frontend/ClientDate"; import { Item, ItemContent } from "@/components/ui/item"; import { cn } from "@/lib/utils"; import { ClockIcon, SparkleIcon } from "lucide-react"; import type { ContributionSummaryRow } from "@/lib/contributions"; import { CONTRIBUTION_RULES } from "@/lib/contributions/rules"; const STATUS_STYLES: Record = { granted: "text-emerald-400 border-emerald-500/40", queued: "text-amber-400 border-amber-500/40", revoked: "text-rose-400 border-rose-500/40", expired: "text-muted-foreground border-border", }; const STATUS_LABELS: Record = { granted: "Granted", queued: "Queued", revoked: "Revoked", expired: "Expired", }; /** * Granted / queued contribution XP totals plus a recent history list. * Server-rendered; the profile page queries the ledger and passes rows in. */ export function ContributionHistory({ granted, queued, rows, isOwner, }: { granted: number; queued: number; rows: ContributionSummaryRow[]; isOwner: boolean; }) { return (
Granted XP {granted.toLocaleString()} Queued XP {queued.toLocaleString()} Granted when the mission completes
{rows.length > 0 ? (
    {rows.map((row) => (
  • {row.status === "queued" ? ( ) : ( )}

    {row.summary}

    {CONTRIBUTION_RULES[row.type]?.label ?? row.type} {row.revokedReason ? ` \u00b7 ${row.revokedReason}` : ""}

    +{row.points} {STATUS_LABELS[row.status] ?? row.status}
  • ))}
) : (

{isOwner ? "You have not earned any contribution XP yet. Edit the wiki, help plan a mission, or answer a survey." : "No contributions on record yet."}

)}
); }