import Link from "next/link"; import { chapters } from "@/content/ebook"; type ChapterNavProps = { chapterId: string; }; export function ChapterNav({ chapterId }: ChapterNavProps) { const index = chapters.findIndex((c) => c.id === chapterId); if (index < 0) return null; const prev = index > 0 ? chapters[index - 1] : null; const next = index < chapters.length - 1 ? chapters[index + 1] : null; return ( ); }