CoolFace
Apppublic

andito/parakeet-v3-streaming

sourceHugging Faceupdated 8mo agoView on Hugging Face
94likes
Progress.jsx38 linesDownload Raw Back to components
1/**2 * Progress Component3 *4 * Displays download progress for model files5 */6 7export default function Progress({ text, percentage, total }) {8  const formatBytes = (bytes) => {9    if (bytes === 0) return '0 B';10    const k = 1024;11    const sizes = ['B', 'KB', 'MB', 'GB'];12    const i = Math.floor(Math.log(bytes) / Math.log(k));13    return `${(bytes / Math.pow(k, i)).toFixed(1)} ${sizes[i]}`;14  };15 16  const progress = percentage || 0;17  const totalSize = total ? formatBytes(total) : '';18 19  return (20    <div className="w-full mb-3">21      <div className="flex justify-between items-center mb-1">22        <span className="text-sm text-gray-300 truncate flex-1 mr-2">23          {text}24        </span>25        <span className="text-xs text-gray-400 whitespace-nowrap">26          {progress}% {totalSize && `(${totalSize})`}27        </span>28      </div>29      <div className="w-full bg-gray-700 rounded-full h-2">30        <div31          className="bg-blue-500 h-2 rounded-full transition-all duration-300"32          style={{ width: `${progress}%` }}33        />34      </div>35    </div>36  );37}38