import React from 'react'; import { ChevronLeft, ChevronRight } from 'lucide-react'; import { cn } from '@/lib/utils'; export interface DiffNavigatorProps extends React.HTMLAttributes { total: number; /** 0-based index */ currentIndex: number; onPrev: () => void; onNext: () => void; } export default function DiffNavigator({ total, currentIndex, onPrev, onNext, className, ...props }: DiffNavigatorProps) { const isFirst = currentIndex <= 0; const isLast = currentIndex >= total - 1; if (total === 0) { return (
无差异
); } return (
{currentIndex + 1} /{' '} {total}
); }