File size: 773 Bytes
d3c7f96
 
 
 
 
 
c38a89e
d3c7f96
c38a89e
d3c7f96
 
 
c38a89e
d3c7f96
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
export default function LoadingBar({ loadProgress, isCached }) {
  const percent = loadProgress?.progress != null ? Math.round(loadProgress.progress) : 0;
  const fileName = loadProgress?.file?.split("/").pop() || "";

  return (
    <div className="w-72 flex flex-col items-center gap-2">
      <div className="w-full h-1.5 bg-[var(--color-surface)] rounded-full overflow-hidden">
        <div
          className="h-full bg-[var(--color-blue)] transition-all duration-300 rounded-full"
          style={{ width: `${percent}%` }}
        />
      </div>
      <p className="text-[var(--color-text-secondary)] text-xs">
        {isCached ? "Loading from cache" : "Downloading model"}
        {fileName ? ` — ${fileName} ${percent}%` : "..."}
      </p>
    </div>
  );
}