import ImageList from "@/components/lists/ImageList"; import prisma from "@/lib/prisma"; export default async function GalleryPage({ params }: { params: { gallerySlug: string, albumSlug: string } }) { const { gallerySlug, albumSlug } = await params; const gallery = await prisma.gallery.findUnique({ where: { slug: gallerySlug }, select: { id: true }, }); if (!gallery) { throw new Error("Gallery not found"); } const album = await prisma.album.findUnique({ where: { galleryId_slug: { galleryId: gallery.id, slug: albumSlug, }, }, include: { images: { include: { colors: { include: { color: true } } } }, } }) return (
{album && ( <>

Album: {album.name}

{album.description}

)}
); }