'use client' import { motion } from 'framer-motion' import { Loader2, CheckCircle2, XCircle, Clock } from 'lucide-react' interface ProgressItem { url: string status: 'pending' | 'processing' | 'success' | 'error' error?: string } interface BatchProgressProps { items: ProgressItem[] currentIndex: number startTime?: number } export default function BatchProgress({ items, currentIndex, startTime }: BatchProgressProps) { const completedCount = items.filter(i => i.status === 'success' || i.status === 'error').length const successCount = items.filter(i => i.status === 'success').length const errorCount = items.filter(i => i.status === 'error').length const progress = items.length > 0 ? (completedCount / items.length) * 100 : 0 const elapsedTime = startTime ? Math.round((Date.now() - startTime) / 1000) : 0 return (
{/* Progress Bar */}
Processing {completedCount} of {items.length} URLs
{elapsedTime}s {Math.round(progress)}%
{/* Stats Summary */}
{items.length}
Total
{successCount}
Success
{errorCount}
Failed
{/* Item List */}
{items.map((item, index) => ( {/* Status Icon */}
{item.status === 'pending' && (
)} {item.status === 'processing' && ( )} {item.status === 'success' && ( )} {item.status === 'error' && ( )}
{/* URL */}
{item.url}
{item.error && (
{item.error}
)}
{/* Index */}
#{index + 1}
))}
) }