import { Button } from '@/components/ui'; interface ProgressCardProps { progress: number; estimatedTimeRemaining?: string; onCancel: (e?: React.MouseEvent) => void; operationType?: 'sync' | 'load' | 'library' | 'audiobook'; cancelText?: string; currentChapter?: string; completedChapters?: number; statusMessage?: string; } export function ProgressCard({ progress, estimatedTimeRemaining, onCancel, operationType, cancelText = 'Cancel', currentChapter, completedChapters, statusMessage }: ProgressCardProps) { const getOperationLabel = () => { if (operationType === 'sync') return 'Saving to Server'; if (operationType === 'load') return 'Loading from Server'; if (operationType === 'library') return 'Importing Library'; if (operationType === 'audiobook') return 'Generating Audiobook'; return null; }; const operationLabel = getOperationLabel(); return (
{/* Header with operation type and cancel button */}
{operationLabel && (
{operationLabel}
)} {statusMessage && (
{statusMessage}
)} {currentChapter && (
{currentChapter}
)}
{/* Progress bar */}
{/* Stats row */}
{completedChapters !== undefined && ( <> {completedChapters} chapters )} {Math.round(progress)}% {estimatedTimeRemaining && ( <> {estimatedTimeRemaining} )}
); }