14 lines · 502 B
export function ProgressBar({ done, total }: { done: number; total: number }) {
  const percent = total === 0 ? 0 : Math.round((done / total) * 100);
  return (
    <div className="space-y-1">
      <div aria-hidden className="h-1.5 overflow-hidden rounded-full bg-gray-800">
        <div className="h-full rounded-full bg-accent-500" style={{ width: `${percent}%` }} />
      </div>
      <p className="text-xs text-gray-500">
        {done} of {total} done · {percent}%
      </p>
    </div>
  );
}