import type { ImmichAlbum } from '@/lib/immich'; import type { PhotoItem } from './PhotoGrid'; import { PhotoGrid } from './PhotoGrid'; import { BackLink } from '@/components/BackLink'; import type { GridConfig } from '@/lib/config'; import type { LightboxWatermark } from '@/components/Lightbox'; import Image from 'next/image'; import React from 'react'; import { getServerDictionary } from '@/lib/i18n/server'; import { albumMetaDetail } from '@/lib/albumMeta'; import { AlbumNav } from '@/components/AlbumNav'; import { StructuredData } from '@/components/StructuredData'; import type { AlbumNavPair } from '@/lib/albumNav'; import type { ProofSessionInit } from '@/components/ProofingContext'; interface AlbumDetailViewProps { album: ImmichAlbum; images: PhotoItem[]; layout: GridConfig['layout']; gridStyle: React.CSSProperties; /** Omitted on a client proofing link, which has nowhere to go back to. */ backLinkHref?: string; backLinkLabel?: string; subtitle?: string; heroImageUrl?: string; heroBlurDataURL?: string; watermark?: LightboxWatermark; /** Whether the lightbox may offer its info panel at all. */ showExifPanel?: boolean; /** Whether the header may name the camera and lens. Follows the `camera` group. */ showGear?: boolean; /** Client proofing — favorite hearts, selection bar and send-off modal. */ proofing?: boolean; /** Offer the "send by email" button in the proofing modal. */ allowMailto?: boolean; /** * `encodeEmail()` of where the proofing dialog's "email to photographer" * goes, when one is configured (#736). Encoded, like every address the site * renders, so the plain form stays out of the HTML and the RSC payload. */ encodedMailto?: string; /** * The ZIP endpoint for this album, when it offers downloads (#475). Renders a * "download album" link in the header and lets the proofing modal offer a * "download selected" action. */ downloadArchiveUrl?: string; /** Neighbouring albums in the surrounding list, for the foot navigation. */ nav?: AlbumNavPair; /** JSON-LD for this album, or null when no site URL is configured (#472). */ structuredData?: Record | null; /** A client proofing link's session; see PhotoGrid. */ proofSession?: ProofSessionInit; /** Rendered under the title — the proofing link's greeting and notes. */ intro?: React.ReactNode; } export function AlbumDetailView({ album, images, layout, gridStyle, backLinkHref, backLinkLabel, subtitle, heroImageUrl, heroBlurDataURL, watermark, showExifPanel = true, showGear = true, proofing, allowMailto, encodedMailto, downloadArchiveUrl, nav, structuredData, proofSession, intro, }: AlbumDetailViewProps) { const metaDetail = albumMetaDetail(album, showGear); const t = getServerDictionary(); return ( <> {structuredData && } {heroImageUrl && (
{album.albumName}
)}
{backLinkHref && }

{album.albumName}

{subtitle && (

{subtitle}

)} {album.description &&

{album.description}

} {intro} {downloadArchiveUrl && ( {t.common.downloadAlbum} )}

{t.common.photos(images.length)} {metaDetail.date && · {metaDetail.date}} {metaDetail.gear && {metaDetail.gear}}

{nav && } ); }