From c363a78ac78115518d0d92d52703e5c6a3b4a808 Mon Sep 17 00:00:00 2001 From: jacek Date: Tue, 20 Oct 2026 10:27:29 +0200 Subject: [PATCH] asd --- src/app/page.js | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/app/page.js b/src/app/page.js index 599fcbb..69d5ce6 100644 --- a/src/app/page.js +++ b/src/app/page.js @@ -1,6 +1,5 @@ import * as React from "react" -import { Card, CardContent } from "@/components/ui/card" import { Carousel, CarouselContent, @@ -9,26 +8,32 @@ import { CarouselPrevious, } from "@/components/ui/carousel" -export async function CarouselDemo() { -const res = await fetch("https://db.jacekr.tech/api/collections/klasy/records?perPage=50"); +export const instant = false -if (!res.ok) { - throw new Error("Failed to fetch data"); -} +export default async function CarouselDemo() { + const res = await fetch( + "https://db.jacekr.tech/api/collections/klasy/records?perPage=50" + ) -const data = await res.json(); + if (!res.ok) { + throw new Error("Failed to fetch data") + } + + const data = await res.json() + const classes = Array.isArray(data.items) ? data.items : [] return ( - {data.map((_, index) => ( - + {classes.map((schoolClass) => ( +
- - - {index + 1} - - +
+ {schoolClass.nazwa} + + {schoolClass.ilosc_uczniow} uczniów + +
))}