import { headers } from "next/headers"; import { requireActiveEditorial } from "@/modules/auth/principal"; import { lightboxService } from "@/modules/lightbox/service"; import { immichClient } from "@/modules/immich/client"; import Image from "next/image"; import Link from "next/link"; import { RemoveLightboxItemButton } from "./RemoveLightboxItemButton"; import { DownloadLightboxForm } from "./DownloadLightboxForm"; export default async function LightboxPage() { const principal = await requireActiveEditorial(new Headers(await headers())); const items = await lightboxService.getLightboxItems(principal.editorialId); // Fetch asset details for all items in the lightbox const assets = items.length > 0 ? await immichClient.searchAssets({ assetIds: items.map(i => i.assetId) }) : []; const assetMap = new Map(assets.map(a => [a.id, a])); return (

Merkzettel

Dein Leuchtkasten

{items.length === 0 ? (

Dein Leuchtkasten ist leer.

) : ( <>

{items.length} {items.length === 1 ? 'Bild' : 'Bilder'} gemerkt

i.assetId)} />
)}
); }