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

Function LatestCreatures

components/latest-creatures.tsx:7–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5
6import { buttonVariants } from "./ui/button";
7
8export default async function LatestCreatures() {
9 const creatures = await getTenLatestCreatures();
10
11 if (creatures.length === 0) {
12 return (
13 <div className="flex min-h-30 w-full flex-col sm:max-w-lg">
14 <h2 className="text-sm">No creatures yet</h2>
15 </div>
16 );
17 }
18
19 return (
20 <div className="flex min-h-30 w-full flex-col sm:max-w-lg">
21 <h2 className="text-sm">Latest Creatures</h2>
22 <div className="flex flex-wrap gap-2">
23 {creatures.map((creature) => {
24 const username = creature.githubProfileUrl.split("/").pop();
25
26 return (
27 <Link
28 key={creature.id}
29 className={cn(buttonVariants(), "w-24")}
30 href={`/${username}`}
31 >
32 <span className="truncate">{username}</span>
33 </Link>
34 );
35 })}
36 </div>
37 </div>
38 );
39}

Callers

nothing calls this directly

Calls 1

getTenLatestCreaturesFunction · 0.90

Tested by

no test coverage detected