'use client'; import { useDownloadContext } from '@/contexts/download-context'; import { Progress } from '@/components/ui/progress'; import { Button } from '@/components/ui/button'; import { X } from 'lucide-react'; import { cn } from '@/lib/utils'; export function GlobalDownloadStatusBar() { const { state, cancelDownload } = useDownloadContext(); if (!state.isDownloading) { return null; } const { progress, currentModel, isCancelling } = state; const modelDisplayName = currentModel || 'Modelo'; const percent = progress.percent ?? 0; const hasSizeInfo = progress.totalBytes > 0 && progress.downloadedBytes > 0; return (
{isCancelling ? ( 'Cancelando download...' ) : ( `Baixando Modelo: ${modelDisplayName} (${percent}%)` )} {progress.speed && !isCancelling && ( {progress.speed} )}
{hasSizeInfo && (
{progress.downloadedFormatted} / {progress.totalFormatted} {progress.status && ( {progress.status} )}
)}
); }