diff --git a/src/components/GrimoireWelcome.tsx b/src/components/GrimoireWelcome.tsx index 6791e47..abb0493 100644 --- a/src/components/GrimoireWelcome.tsx +++ b/src/components/GrimoireWelcome.tsx @@ -1,10 +1,12 @@ -import { Terminal } from "lucide-react"; +import { Terminal, Trophy } from "lucide-react"; import { Button } from "./ui/button"; import { Kbd, KbdGroup } from "./ui/kbd"; import { Progress } from "./ui/progress"; -import { MONTHLY_GOAL_SATS } from "@/services/supporters"; +import supportersService, { MONTHLY_GOAL_SATS } from "@/services/supporters"; import { useLiveQuery } from "dexie-react-hooks"; import db from "@/services/db"; +import { useProfile } from "@/hooks/useProfile"; +import { getDisplayName } from "@/lib/nostr-utils"; interface GrimoireWelcomeProps { onLaunchCommand: () => void; @@ -28,6 +30,36 @@ const EXAMPLE_COMMANDS = [ { command: "req -k 1 -l 20", description: "Query recent notes" }, ]; +function TopContributor({ + pubkey, + amount, +}: { + pubkey: string; + amount: number; +}) { + const profile = useProfile(pubkey); + const displayName = getDisplayName(pubkey, profile); + + function formatNumber(sats: number): string { + if (sats >= 1_000_000) { + return `${(sats / 1_000_000).toFixed(1)}M`; + } else if (sats >= 1_000) { + return `${Math.floor(sats / 1_000)}k`; + } + return sats.toString(); + } + + return ( +