Add artists page
This commit is contained in:
@ -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>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user