"use client"; import { CheckCircle2, CircleDashed, RotateCcw } from "lucide-react"; import { Badge } from "@/components/ui/Badge"; import { Button } from "@/components/ui/Button"; import { cardClass } from "@/lib/ui/variants"; import type { StyleDriftReport, StyleDriftSegment } from "@/lib/review/sse"; interface StylePanelProps { style: StyleDriftReport | null; incomplete: boolean; // 选中段做回炉(打开 RefineView)。 onRefine: (segment: StyleDriftSegment) => void; } // 整体相似度的四分圆字符档(◔◑◕●),按 score 映射(UX §6.4 ③)。 const QUARTER_CHARS = ["○", "◔", "◑", "◕", "●"] as const; function quarterChar(score: number): string { const clamped = Math.min(100, Math.max(0, score)); const idx = Math.round((clamped / 100) * (QUARTER_CHARS.length - 1)); return QUARTER_CHARS[idx] ?? QUARTER_CHARS[0]; } // 文风审区(UX §6.4 ③):整体相似度 ◔% + 漂移段列表,每段可一键回炉。只读建议。 export function StylePanel({ style, incomplete, onRefine }: StylePanelProps) { return (

文风 (style-auditor)

{incomplete ? ( ) : style === null ? (

无文风报告(学文风后第四审才能打分)。

) : (

整体相似度 {style.score}%

{style.segments.length === 0 ? ( ) : ( )}
)}
); }