-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathprogress-section.tsx
More file actions
42 lines (38 loc) · 1.09 KB
/
progress-section.tsx
File metadata and controls
42 lines (38 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// components/csv-uploader/progress-section.tsx
"use client";
import { Progress } from "@/components/ui/progress";
import { Badge } from "./ui/badge";
export type ProgressSectionProps = {
status: string;
progress?: number;
message?: string;
prompt?: string;
durationInSeconds?: number;
finalUrl?: string;
};
export function ProgressSection({
progress,
status,
message,
prompt,
}: ProgressSectionProps) {
return (
<div className="w-full space-y-3 min-h-32">
<div className="flex justify-between items-center gap-2">
<p className="text-sm font-semibold truncate w-[80%]">
{prompt || " "}
</p>
<Badge variant="default" className="gap-2">
{status === "EXECUTING" && (
<div className="inline-flex items-center">
<div className="w-3 h-3 border border-current border-t-transparent rounded-full animate-spin" />
</div>
)}
{status || " "}
</Badge>
</div>
<Progress value={progress} />
<p className="text-sm font-medium">{message || " "}</p>
</div>
);
}