MCPcopy Create free account
hub / github.com/TheOrcDev/github-creature / CreatureStats

Function CreatureStats

components/creature-stats.tsx:24–103  ·  view source on GitHub ↗
({
  creature,
  downloadTargetId,
}: CreatureStatsProps)

Source from the content-addressed store, hash-verified

22 creature: SelectCreature;
23 downloadTargetId?: string;
24 hideIdentity?: boolean;
25 className?: string;
26}
27
28export default async function CreatureStats({
29 creature,
30 downloadTargetId,
31 hideIdentity,
32 className,
33}: CreatureStatsProps) {
34 const topPercentage = await getCreatureTopPercentage(creature.id);
35
36 return (
37 <Card
38 className={cn(
39 "flex w-full max-w-92 min-h-[600px] flex-col justify-between bg-linear-to-b from-primary/6 to-background",
40 className
41 )}
42 >
43 <CardHeader className="border-b">
44 {hideIdentity ? null : (
45 <>
46 <CardTitle className="text-lg sm:text-xl font-bold tracking-tight">
47 {creature.name}
48 </CardTitle>
49 <CardDescription className="text-sm text-foreground/75">
50 {creature.description}
51 </CardDescription>
52 </>
53 )}
54 <CardAction
55 className={hideIdentity ? "col-start-1 row-start-1" : undefined}
56 >
57 <Badge variant="secondary" className="whitespace-nowrap">
58 Top {topPercentage}%
59 </Badge>
60 </CardAction>
61 </CardHeader>
62
63 <CardContent className="pt-4">
64 <div className="flex flex-col gap-2">
65 <Link
66 className={buttonVariants({ size: "sm", variant: "outline" })}
67 href={creature.githubProfileUrl}
68 rel="noreferrer"
69 target="_blank"
70 >
71 View on GitHub
72 </Link>
73 <div className="rounded-none border border-border/70 bg-background/40 p-3">
74 <div className="text-[11px] uppercase tracking-wide text-muted-foreground">
75 Contributions
76 </div>
77 <div className="mt-1 text-base font-semibold tabular-nums">
78 {creature.contributions}
79 </div>
80 </div>
81

Callers

nothing calls this directly

Calls 1

getCreatureTopPercentageFunction · 0.90

Tested by

no test coverage detected