Add diff expansion controls with ContentDiffViewer and CodePreview components

This commit is contained in:
Chris Scott committed 2025-12-26 18:07:33 -05:00
1 parent 55b6ab3c87
commit 4fd658fc7d
11 files changed
+549 -53

No files matched your search

@@ -0,0 +1,31 @@
interface DiffStatsProps {
additions: number
deletions: number
variant?: 'default' | 'compact'
}
export function DiffStats({ additions, deletions, variant = 'default' }: DiffStatsProps) {
if (additions === 0 && deletions === 0) {
return null
}
const compact = variant === 'compact'
return (
<span className="flex items-center gap-1 text-xs font-mono">
{additions > 0 && (
<span className="text-green-600 dark:text-green-400">
{compact ? `+${additions}` : `+${additions}`}
</span>
)}
{additions > 0 && deletions > 0 && (
<span className="text-muted-foreground">{compact ? '/' : ' '}</span>
)}
{deletions > 0 && (
<span className="text-red-600 dark:text-red-400">
{compact ? `-${deletions}` : `-${deletions}`}
</span>
)}
</span>
)
}