Add artists page

This commit is contained in:
2025-06-29 14:22:26 +02:00
parent 1dba1cf093
commit 2e1161b50b
18 changed files with 321 additions and 94 deletions

View File

@ -0,0 +1,43 @@
import ImageList from "@/components/albums/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: true
}
})
return (
<div className="max-w-7xl mx-auto px-4 py-12 space-y-12">
{album && (
<>
<section className="text-center space-y-4">
<h1 className="text-4xl font-bold tracking-tight">{album.name}</h1>
<p className="text-lg text-muted-foreground">
{album.description}
</p>
</section>
<ImageList images={album.images} gallerySlug={gallerySlug} albumSlug={albumSlug} />
</>
)}
</div>
);
}