MCPcopy Create free account
hub / github.com/evolify/dumpfun / LaunchpadsTable

Function LaunchpadsTable

app/modules/table.tsx:43–126  ·  view source on GitHub ↗
(props: Props)

Source from the content-addressed store, hash-verified

41const headerClass = "text-sm text-white-100"
42
43export default function LaunchpadsTable(props: Props) {
44 const [duration, setDuration] = useState<Duration>("1d")
45
46 const list = use(props.data).slice(0, 10)
47
48 const totalVolume = useMemo(() => {
49 return list.reduce(
50 (acc, item) => acc + getLaunchpadStats(item, duration).volume,
51 0
52 )
53 }, [list])
54
55 return (
56 <Card>
57 <CardHeader className="flex items-center">
58 <CardTitle> Launchpads Detail </CardTitle>
59 <CardAction className="flex items-center gap-2 ml-auto">
60 <div className="text-sm text-gray-400 ml-auto">Duration</div>
61 <DurationFilter value={duration} onChange={setDuration} />
62 </CardAction>
63 </CardHeader>
64 <CardContent>
65 <Table>
66 <TableCaption>Top 10 Launchpads</TableCaption>
67 <TableHeader>
68 <TableRow className="text-sm text-gray-400">
69 <TableHead className={headerClass}>Launchpad</TableHead>
70 <TableHead className={headerClass}>{duration} Volume</TableHead>
71 <TableHead className={headerClass}>{duration} Trades</TableHead>
72 <TableHead className={headerClass}>{duration} Mints</TableHead>
73 <TableHead className={headerClass}>{duration} Bonded</TableHead>
74 <TableHead className={headerClass}>{duration} Bonded %</TableHead>
75 <TableHead className={cls(headerClass, "text-right")}>
76 {duration} Market Share
77 </TableHead>
78 </TableRow>
79 </TableHeader>
80
81 <TableBody>
82 {list.map(item => {
83 const stats = getLaunchpadStats(item, duration)
84 return (
85 <TableRow
86 className="relative"
87 key={item.launchpad}
88 style={{
89 background: getBackground(stats.volume / totalVolume),
90 }}
91 >
92 <TableCell className="font-medium">
93 <div className="flex flex-row items-center gap-2">
94 <Icon src={item.icon} size={16} />
95 {item.launchpad}
96 </div>
97 </TableCell>
98
99 <TableCell className="text-blue-500">
100 {formatNumber(stats.volume)}

Callers

nothing calls this directly

Calls 4

getLaunchpadStatsFunction · 0.90
formatNumberFunction · 0.90
percentFunction · 0.90
getBackgroundFunction · 0.85

Tested by

no test coverage detected