"use client"; import Link from "next/link"; import { ArrowRight, CheckCircle2, ListTree } from "lucide-react"; import { Button } from "@/components/ui/Button"; import { StatusNote } from "@/components/ui/StatusNote"; import type { AcceptResponse } from "@/lib/api/types"; import { buildAcceptPreview } from "@/lib/review/accept-preview"; import { ThinkingIndicator } from "@/components/ThinkingIndicator"; import { buttonClass } from "@/lib/ui/variants"; interface AcceptPanelProps { projectId: string; chapterNo: number; // 本页是否已有审稿结果(进页带留痕 或 本次重审完成)。用于区分 // 「审过且 0 冲突→可直接验收」与「未审稿→先审稿」,避免把"未知"当"无冲突"。 reviewed: boolean; conflictCount: number; unresolvedCount: number; // R3:当前伏笔建议数(验收前清单提醒,只读不自动落库)。 foreshadowCount: number; accepting: boolean; result: AcceptResponse | null; onAccept: () => void; } // 验收 gate(UX §9 / §8.4):未决禁验收(置灰 + 文案),验收后呈现「本次将更新」清单。 export function AcceptPanel({ projectId, chapterNo, reviewed, conflictCount, unresolvedCount, foreshadowCount, accepting, result, onAccept, }: AcceptPanelProps) { const blocked = unresolvedCount > 0; const preview = buildAcceptPreview({ conflictCount, foreshadowSuggestions: foreshadowCount, }); if (result) { return (

终稿已晋升为正式版本,章节摘要和裁决留痕已按验收事务写回。

版次
v{result.accepted_version}
摘要
{result.digest_added ? "已新增" : "未变更"}
裁决
{result.decisions_recorded}
{result.review_id ? (

留痕:{result.review_id}

) : null} {/* 验收闭环 → 写下一章入口(修「验收后无路可走」的断点)。 */}
); } return (
{blocked ? ( 尚有 {unresolvedCount} 项冲突未裁决,处理完才能验收。 ) : ( <> {conflictCount === 0 ? reviewed ? "无冲突,可直接验收。" : "尚未审稿——建议先点「重新审稿」确认本章无冲突,再验收。" : "全部冲突已裁决,可验收本章。"} {/* R3:验收前「本次将更新」清单(预期,落库口径以验收回执为准)。 */}

本次验收将更新

以上为预期,最终以验收回执为准。

)}
); }