()
| 5 | |
| 6 | import { buttonVariants } from "./ui/button"; |
| 7 | |
| 8 | export 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 | } |
nothing calls this directly
no test coverage detected