import { fetchLibraries, fetchSeries, getBookCoverUrl, LibraryDto, SeriesDto } from "../../../../lib/api"; import Image from "next/image"; import Link from "next/link"; import { notFound } from "next/navigation"; import { LibrarySubPageHeader } from "../../../components/LibrarySubPageHeader"; export const dynamic = "force-dynamic"; export default async function LibrarySeriesPage({ params }: { params: Promise<{ id: string }>; }) { const { id } = await params; const [library, series] = await Promise.all([ fetchLibraries().then(libs => libs.find(l => l.id === id)), fetchSeries(id).catch(() => [] as SeriesDto[]) ]); if (!library) { notFound(); } return (
{s.book_count} book{s.book_count !== 1 ? 's' : ''}
No series found in this library