import type { Metadata } from 'next'; import { Archive } from 'lucide-react'; import { fetchPublicPosts } from '@/api/publicPosts'; import ArchiveExplorer from '@/components/post/ArchiveExplorer'; import WindowSurface from '@/components/ui/WindowSurface'; import { SITE_NAME } from '@/lib/site'; import { PostListResponse } from '@/types'; export const dynamic = 'force-dynamic'; export const revalidate = 300; export const metadata: Metadata = { title: 'Archive', alternates: { canonical: '/archive', }, openGraph: { title: `Archive | ${SITE_NAME}`, url: '/archive', siteName: SITE_NAME, type: 'website', }, }; const getTotalElements = (data?: PostListResponse | null) => { return data?.page?.totalElements ?? data?.totalElements ?? 0; }; export default async function ArchivePage() { const data = await fetchPublicPosts({ page: 0, size: 1000, sort: 'createdAt,desc' }); const posts = data?.content || []; const totalPosts = getTotalElements(data); return (

아카이브

지금까지 작성한 {totalPosts.toLocaleString()}개의 글을 기록 순서로 정리했습니다.

); }