Elffuss BraidHub

kikocis/continue public

main · 824 BRawPermalink
1import { IndexingProgressUpdate } from "core";
2import { getProgressPercentage } from "./IndexingProgress";
3
4export interface IndexingProgressBarProps {
5 update: IndexingProgressUpdate;
6}
7
8function IndexingProgressBar({ update }: IndexingProgressBarProps) {
9 // Show 100% red progress bar if indexing failed
10 const progressPercentage =
11 update.status === "failed" ? 100 : getProgressPercentage(update.progress);
12
13 return (
14 <div className="my-2 h-1.5 w-full rounded-md border border-solid border-gray-400">
15 <div
16 className={`h-full rounded-lg transition-all duration-200 ease-in-out ${
17 update.status === "failed" ? "bg-red-600" : "bg-stone-500"
18 }`}
19 style={{
20 width: `${progressPercentage}%`,
21 }}
22 />
23 </div>
24 );
25}
26
27export default IndexingProgressBar;