inffo2/src/app/favorites/page.tsx

19 lines
726 B
TypeScript

import { EventList } from "@/components/EventList";
import { getEventsByIds } from "@/db";
import { cookies } from "next/headers";
export default async function FavoritesPage() {
const cookieStore = await cookies();
const favoritesCookie = cookieStore.get("favorites")?.value || "[]";
const favoritesArray: number[] = JSON.parse(favoritesCookie);
const favorites = await getEventsByIds(favoritesArray);
return (
<div className="flex flex-col items-center justify-items-center p-8 pb-20 gap-4 sm:p-20 w-full">
<h1 className="text-3xl font-bold mb-4 w-full">Oblíbené</h1>
<main className="flex flex-col gap-8 w-full">
<EventList events={favorites} showDate showLine />
</main>
</div>
);
}