"use client"; import type { ReviewConflict } from "@/lib/review/sse"; import type { DecisionDraft, Verdict } from "@/lib/review/decisions"; interface ConflictCardProps { index: number; conflict: ReviewConflict; draft: DecisionDraft; missing: boolean; onVerdict: (index: number, verdict: Verdict) => void; onNote: (index: number, note: string) => void; onJump: (index: number) => void; } const VERDICT_OPTIONS: { value: Verdict; label: string }[] = [ { value: "accept", label: "采纳改法" }, { value: "ignore", label: "忽略" }, { value: "manual", label: "手改" }, ]; // 单个冲突报告卡(UX §6.4):五类徽标 + where + refs + suggestion + 裁决三态。 // 冲突=赭红;未决/缺判时加图标+文案(不单靠色,a11y §10)。 export function ConflictCard({ index, conflict, draft, missing, onVerdict, onNote, onJump, }: ConflictCardProps) { const resolved = draft.verdict !== null; return (
  • {conflict.suggestion}

    {conflict.where ? ( ) : null} {conflict.refs.map((ref) => ( ▸ {ref} ))}
    冲突 {index + 1} 裁决
    {VERDICT_OPTIONS.map((opt) => { const active = draft.verdict === opt.value; return ( ); })} {resolved ? ( ) : ( 未裁决 )}
    {draft.verdict === "manual" ? (
    onNote(index, e.target.value)} placeholder="手改说明(可选)" className="w-full rounded border border-line bg-bg px-3 py-1.5 text-sm text-ink focus:border-cinnabar focus:outline-none" />
    ) : null}
  • ); }