Download frontend/src/components/AppShell.tsx from scomb2/Radar: direct link, hf CLI and curl.
- Browser
- Download file 1.08 kB
-
https://huggingface.co/spaces/scomb2/Radar/resolve/main/frontend/src/components/AppShell.tsx
- Command line
-
hf download hf://spaces/scomb2/Radar/frontend/src/components/AppShell.tsx
-
curl -L -o AppShell.tsx https://huggingface.co/spaces/scomb2/Radar/resolve/main/frontend/src/components/AppShell.tsx
1.08 kB
| import { useState } from "react"; | |
| import Uploader from "./Uploader"; | |
| import ResultsTable from "./ResultsTable"; | |
| import type { DiagnoseResult } from "../lib/radar"; | |
| import { diagnoseRemote } from "../lib/radar"; | |
| export default function AppShell() { | |
| const [result, setResult] = useState<DiagnoseResult | null>(null); | |
| const [busy, setBusy] = useState(false); | |
| const [error, setError] = useState<string | null>(null); | |
| const [lastFiles, setLastFiles] = useState<File[]>([]); | |
| async function run(files: File[]) { | |
| setBusy(true); | |
| setError(null); | |
| setLastFiles(files); | |
| try { | |
| setResult(await diagnoseRemote(files)); | |
| } catch (e) { | |
| setError(e instanceof Error ? e.message : "GPU busy or unreachable — Retry"); | |
| } finally { | |
| setBusy(false); | |
| } | |
| } | |
| return ( | |
| <div className="space-y-6"> | |
| <Uploader busy={busy} onSubmit={run} /> | |
| <ResultsTable | |
| result={result} | |
| busy={busy} | |
| error={error} | |
| onRetry={() => { | |
| if (lastFiles.length > 0) run(lastFiles); | |
| }} | |
| /> | |
| </div> | |
| ); | |
| } | |