Files
website/src/components/CommunityShowcase.astro
2024-06-11 18:32:25 -04:00

22 lines
508 B
Plaintext

---
import { z } from "astro/zod";
import BotCarousel from "~/components/BotCarousel";
import { BotSchema } from "~/utils/types";
import { zodFetch } from "~/utils/fetch";
import { shuffle } from "~/utils/shuffle";
const botResponse = await zodFetch(
z.array(BotSchema),
"Failed to fetch community bot data",
"https://frontpage.sern.dev/getBots",
);
if (!botResponse.ok) {
return console.error(botResponse.error);
}
---
<div>
<BotCarousel bots={shuffle(botResponse.value)} client:load />
</div>