import { getMemberToken, getApiBaseUrl } from '../../_lib/api'; import Link from 'next/link'; interface Album { id: string; title: string; description: string | null; coverUrl: string | null; itemCount: number; createdAt: string; } async function fetchAlbums(token: string): Promise { const res = await fetch(`${getApiBaseUrl()}/my/memories`, { headers: { Authorization: `Bearer ${token}` }, cache: 'no-store', }).catch(() => null); if (!res || !res.ok) return []; return (await res.json()) as Album[]; } export default async function MemoriesPage() { const token = await getMemberToken(); if (!token) return null; const albums = await fetchAlbums(token); return (

Memories

← Dashboard
{albums.length === 0 ? (

No photo albums yet.

Your chapter admin will share event photos and memories here.

) : (
{albums.map((a) => (
{a.coverUrl ? ( // eslint-disable-next-line @next/next/no-img-element {a.title} ) : (
🖼️
)}

{a.title}

{a.itemCount} photo{a.itemCount !== 1 ? 's' : ''}

))}
)}
); }