import Link from "next/link"; import { buildChapterEntries, type ChapterEntry } from "@/lib/workbench/chapter"; interface ChapterListProps { projectId: string; // 大纲章节(来自 GET .../outline,无大纲时为空);当前章会被并入并去重。 chapters: ChapterEntry[]; currentChapterNo: number; } // 左栏目录(UX §6.3):列出大纲全部章节 + 当前章,点击切换写作章号(`?chapter=N`)。 // 桌面 aside 包裹;移动端经 Workbench 抽屉复用 ChapterListContent。 export function ChapterList({ projectId, chapters, currentChapterNo, }: ChapterListProps) { return ( ); } export function ChapterListContent({ projectId, chapters, currentChapterNo, }: ChapterListProps) { const entries = buildChapterEntries(chapters, currentChapterNo); const hasOutline = chapters.length > 0; return ( <>

目录

{!hasOutline ? (

还没有章节目录。 去「大纲」生成 。

) : null} ); }