2026-03-08 18:55:45 +01:00
|
|
|
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';
|
2026-05-30 15:33:43 +02:00
|
|
|
import Image from 'next/image';
|
2026-03-08 18:55:45 +01:00
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
|
|
interface AlbumDetailViewProps {
|
2026-03-12 11:30:45 +00:00
|
|
|
album: ImmichAlbum;
|
|
|
|
|
images: PhotoItem[];
|
|
|
|
|
layout: GridConfig['layout'];
|
|
|
|
|
gridStyle: React.CSSProperties;
|
|
|
|
|
backLinkHref: string;
|
|
|
|
|
backLinkLabel: string;
|
|
|
|
|
subtitle?: string;
|
2026-05-30 15:33:43 +02:00
|
|
|
heroImageUrl?: string;
|
|
|
|
|
heroBlurDataURL?: string;
|
2026-03-08 18:55:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function AlbumDetailView({
|
2026-03-12 11:30:45 +00:00
|
|
|
album,
|
|
|
|
|
images,
|
|
|
|
|
layout,
|
|
|
|
|
gridStyle,
|
|
|
|
|
backLinkHref,
|
|
|
|
|
backLinkLabel,
|
|
|
|
|
subtitle,
|
2026-05-30 15:33:43 +02:00
|
|
|
heroImageUrl,
|
|
|
|
|
heroBlurDataURL,
|
2026-03-08 18:55:45 +01:00
|
|
|
}: AlbumDetailViewProps) {
|
2026-03-12 11:30:45 +00:00
|
|
|
return (
|
|
|
|
|
<>
|
2026-05-30 15:33:43 +02:00
|
|
|
{heroImageUrl && (
|
|
|
|
|
<div className="album-hero">
|
|
|
|
|
<Image
|
|
|
|
|
src={heroImageUrl}
|
|
|
|
|
alt={album.albumName}
|
|
|
|
|
fill
|
|
|
|
|
priority
|
|
|
|
|
sizes="100vw"
|
|
|
|
|
style={{ objectFit: 'cover' }}
|
|
|
|
|
{...(heroBlurDataURL ? { placeholder: 'blur' as const, blurDataURL: heroBlurDataURL } : {})}
|
|
|
|
|
/>
|
|
|
|
|
<div className="album-hero__overlay" />
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
<div className={`album-header${heroImageUrl ? ' album-header--has-hero' : ''}`}>
|
2026-03-12 11:30:45 +00:00
|
|
|
<BackLink href={backLinkHref} label={backLinkLabel} />
|
|
|
|
|
<h1 className="album-header__title">{album.albumName}</h1>
|
|
|
|
|
{subtitle && (
|
|
|
|
|
<p className="subpage-subtitle" style={{ textAlign: 'left', marginLeft: 0 }}>
|
|
|
|
|
{subtitle}
|
|
|
|
|
</p>
|
|
|
|
|
)}
|
2026-05-29 17:05:12 +02:00
|
|
|
{album.description && <p className="album-header__description">{album.description}</p>}
|
2026-03-12 11:30:45 +00:00
|
|
|
<p className="album-header__meta">
|
|
|
|
|
{images.length} {images.length === 1 ? 'photo' : 'photos'}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<PhotoGrid assets={images} layout={layout} gridStyle={gridStyle} />
|
|
|
|
|
</>
|
|
|
|
|
);
|
2026-03-08 18:55:45 +01:00
|
|
|
}
|