/** * SubpageNav — server component that renders navigation links * for all subpages and standalone albums in the header. */ import Link from 'next/link'; import { immich } from '@/lib/immich'; import { getConfig } from '@/lib/config'; import { listJournalEntries } from '@/lib/admin/journal-service'; import { getServerDictionary } from '@/lib/i18n/server'; export async function SubpageNav() { const [subpages, standaloneAlbums, journalEntries] = await Promise.all([ immich.getSubpages(), immich.getStandaloneAlbums(), listJournalEntries().catch(() => []), ]); // EXPERIMENTAL: external nav links from settings.yaml, appended after the // internal entries. Sanitised to http(s) in getConfig(). const navLinks = getConfig().navLinks; const t = getServerDictionary(); const hasPublicJournal = journalEntries.some((e) => !e.frontmatter.draft); return ( <> {subpages.map((sp) => ( {sp.name} ))} {hasPublicJournal && ( {t.nav.journal} )} {standaloneAlbums.map((album) => ( {album.albumName} ))} {navLinks.map((link) => ( {link.label} ))} ); }