import Link from 'next/link'; import Image from 'next/image'; import { imageUrl } from '@/lib/urls'; interface SubpageAlbum { id: string; slug: string; albumName: string; assetCount: number; albumThumbnailAssetId: string | null; } interface Placeholder { blurDataURL?: string; dominantColor?: string; } interface SubpageGridViewProps { slug: string; albums: SubpageAlbum[]; coverPlaceholders: (Placeholder | null)[]; } export function SubpageGridView({ slug, albums, coverPlaceholders }: SubpageGridViewProps) { return (
{albums.map((album, i) => { const ph = coverPlaceholders[i]; return ( {album.albumThumbnailAssetId ? ( {album.albumName} ) : (
)} {album.assetCount} {album.assetCount === 1 ? 'photo' : 'photos'}
{album.albumName} {album.assetCount} {album.assetCount === 1 ? 'photo' : 'photos'}
); })}
); }