import React from 'react'; import { Tooltip, TooltipContent, TooltipTrigger } from '@renderer/components/ui/tooltip'; import { cn } from '@renderer/lib/utils'; import { Check, Eye, EyeOff, GitMerge, Loader2, Pencil, X } from 'lucide-react'; import type { ChangeStats } from '@shared/types'; interface ReviewToolbarProps { stats: { pending: number; accepted: number; rejected: number }; changeStats: ChangeStats; collapseUnchanged: boolean; applying: boolean; autoViewed: boolean; instantApply?: boolean; onAutoViewedChange: (auto: boolean) => void; onAcceptAll: () => void; onRejectAll: () => void; onApply: () => void; onCollapseUnchangedChange: (collapse: boolean) => void; editedCount?: number; } export const ReviewToolbar = ({ stats, changeStats, collapseUnchanged: _collapseUnchanged, applying, autoViewed, onAutoViewedChange, onAcceptAll, onRejectAll, onApply, onCollapseUnchangedChange: _onCollapseUnchangedChange, instantApply = false, editedCount = 0, }: ReviewToolbarProps): React.ReactElement => { const hasRejected = stats.rejected > 0; const canApply = hasRejected && !applying; const totalChanges = stats.pending + stats.accepted + stats.rejected; const reviewedCount = stats.accepted + stats.rejected; return (
{/* Decision stats */}
{stats.pending > 0 && ( {stats.pending} pending )} {stats.accepted > 0 && ( {stats.accepted} accepted )} {stats.rejected > 0 && ( {stats.rejected} rejected )}
{/* Change stats */}
+{changeStats.linesAdded} -{changeStats.linesRemoved} across {changeStats.filesChanged} files
{/* Review progress */} {totalChanges > 0 && (
{reviewedCount}/{totalChanges}
)}
{/* {collapseUnchanged ? 'Show all lines' : 'Collapse unchanged regions'} */} {autoViewed ? 'Auto-mark files as viewed when scrolled to end (ON)' : 'Auto-mark files as viewed when scrolled to end (OFF)'}
{editedCount > 0 && ( {editedCount} edited )} {editedCount > 0 &&
} {/* Actions */} Accept all changes across all files Reject all changes across all files {!instantApply && ( Apply review decisions across all files )}
); };