import { Album, Image } from "@/generated/prisma"; import NextImage from "next/image"; import Link from "next/link"; type AlbumsWithItems = Album & { coverImage: Image | null; } export default function AlbumList({ albums, gallerySlug }: { albums: AlbumsWithItems[], gallerySlug: string }) { return (

Albums

{albums ? albums.map((album) => (
{album.coverImage?.fileKey ? ( ) : (
No cover image
)}

{album.name}

)) : "There are no albums here!"}
); }