import { CheckCircle2, XCircle } from 'lucide-react'; import { cn } from '@/lib/utils'; import type { ReviewIssue, RevisionSummary } from '../../types/ai-writing'; interface RevisionSummaryCardProps { summary: RevisionSummary; } const CATEGORY_LABEL: Record = { fact: '事实', logic: '逻辑', language: '语言', }; function IssueSummaryRow({ issue, skipped = false }: { issue: ReviewIssue; skipped?: boolean }) { return (
{CATEGORY_LABEL[issue.category] ?? issue.category}
{issue.location && (
位置:{issue.location}
)}
{issue.issue}
{issue.suggestion && (
建议: {issue.suggestion}
)}
); } export function RevisionSummaryCard({ summary }: RevisionSummaryCardProps) { const { revisedIssues, skippedIssues, oldWordCount, newWordCount } = summary; const wordDiff = newWordCount - oldWordCount; return (
{/* 头部 */}
修改完成 {newWordCount.toLocaleString()} 字 {wordDiff !== 0 && ( 0 ? 'text-green-600 dark:text-green-400' : 'text-red-500')}> ({wordDiff > 0 ? '+' : ''}{wordDiff}) )}
{/* 已修改 */} {revisedIssues.length > 0 && (

已修改 {revisedIssues.length} 条意见

{revisedIssues.map((iss, i) => )}
)} {/* 已跳过 */} {skippedIssues.length > 0 && (

跳过 {skippedIssues.length} 条意见

{skippedIssues.map((iss, i) => )}
)} {revisedIssues.length === 0 && skippedIssues.length === 0 && (

已完成修改

)}
); }