Download components/export-progress.tsx from d3evil4/scrape: direct link, hf CLI and curl.
- Browser
- Download file 1.71 kB
-
https://huggingface.co/spaces/d3evil4/scrape/resolve/main/components/export-progress.tsx
- Command line
-
hf download hf://spaces/d3evil4/scrape/components/export-progress.tsx
-
curl -L -o export-progress.tsx https://huggingface.co/spaces/d3evil4/scrape/resolve/main/components/export-progress.tsx
1.71 kB
| "use client"; | |
| import { Download, Loader2 } from "lucide-react"; | |
| import type { RenderProgress } from "@/types"; | |
| import { Button } from "@/components/ui/button"; | |
| import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; | |
| import { Progress } from "@/components/ui/progress"; | |
| interface ExportProgressProps { | |
| progress: RenderProgress | null; | |
| downloadUrl?: string; | |
| filename?: string; | |
| rendering: boolean; | |
| onStartRender: () => void; | |
| } | |
| export function ExportProgress({ | |
| progress, | |
| downloadUrl, | |
| filename, | |
| rendering, | |
| onStartRender, | |
| }: ExportProgressProps) { | |
| return ( | |
| <Card> | |
| <CardHeader> | |
| <CardTitle className="flex items-center gap-2"> | |
| {rendering ? <Loader2 className="h-5 w-5 animate-spin" /> : null} | |
| Export Video | |
| </CardTitle> | |
| </CardHeader> | |
| <CardContent className="space-y-4"> | |
| {!rendering && !downloadUrl && ( | |
| <Button className="w-full" onClick={onStartRender}>Start Render</Button> | |
| )} | |
| {rendering && progress && ( | |
| <div className="space-y-2"> | |
| <div className="flex justify-between text-sm"> | |
| <span className="capitalize">{progress.stage}...</span> | |
| <span>{Math.round(progress.percent)}%</span> | |
| </div> | |
| <Progress value={progress.percent} /> | |
| <p className="text-sm text-zinc-500">{progress.message}</p> | |
| </div> | |
| )} | |
| {downloadUrl && ( | |
| <Button asChild className="w-full"> | |
| <a href={downloadUrl} download={filename}> | |
| <Download className="h-4 w-4" /> Download MP4 | |
| </a> | |
| </Button> | |
| )} | |
| </CardContent> | |
| </Card> | |
| ); | |
| } | |