import { Fragment } from 'react'; import { Transition } from '@headlessui/react'; import { LoadingSpinner } from './Spinner'; interface ProgressPopupProps { isOpen: boolean; progress: number; estimatedTimeRemaining?: string; onCancel: () => void; isProcessing: boolean; statusMessage?: string; operationType?: 'sync' | 'load'; cancelText?: string; } export function ProgressPopup({ isOpen, progress, estimatedTimeRemaining, onCancel, isProcessing, statusMessage, operationType, cancelText = 'Cancel' }: ProgressPopupProps) { return (
{operationType && ( {operationType === 'sync' ? 'Saving to Server' : 'Loading from Server'} )} {statusMessage && {statusMessage}}
{Math.round(progress)}% complete {estimatedTimeRemaining &&
{` ~${estimatedTimeRemaining}`}
}
); }