mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
Add diff expansion controls with ContentDiffViewer and CodePreview components
This commit is contained in:
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>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user