Sdm0 commited on
Commit
df7fb8b
·
verified ·
1 Parent(s): ac5b690

Deploy 48c10a2f

Browse files
Files changed (1) hide show
  1. frontend/src/main.jsx +1 -0
frontend/src/main.jsx CHANGED
@@ -32,6 +32,7 @@ function Receipt({ result }) {
32
  function Ragas({ ragas }) { if (!ragas) return null; const text = ragas.status === "pending" ? "Computing scores in the background…" : ragas.status === "failed" ? `Scoring failed: ${ragas.error || "provider error"}` : ragas.status === "skipped" ? `Skipped: ${ragas.reason || "retrieval context was unavailable"}` : ragas.status === "unavailable" ? `Unavailable: ${ragas.error || "the scoring task was lost"}` : ragas.status === "completed_no_scores" ? (ragas.error || "Completed without metric values") : Object.entries(ragas.scores || {}).map(([key, value]) => `${key}: ${typeof value === "number" ? value.toFixed(3) : value}`).join(" · ") || "Completed without scores"; return <section className="result-card receipt" aria-label="RAGAS retrieval quality"><span className="panel-kicker">Retrieval quality (RAGAS)</span><p>{text}</p></section>; }
33
 
34
  function App() {
 
35
  const [repo, setRepo] = useState(""); const [pr, setPr] = useState(""); const [endpoint, setEndpoint] = useState("auto"); const [provider, setProvider] = useState(""); const [model, setModel] = useState(""); const [apiKey, setApiKey] = useState(""); const [baseUrl, setBaseUrl] = useState("");
36
  const [savedProviders, setSavedProviders] = useState(() => { try { return JSON.parse(localStorage.getItem("ocr-providers") || "[]"); } catch { return []; } });
37
  const [theme, setTheme] = useState(() => localStorage.getItem("ocr-theme") || "light"); const [job, setJob] = useState(null); const [message, setMessage] = useState(""); const [error, setError] = useState(""); const [busy, setBusy] = useState(false); const [user, setUser] = useState(null);
 
32
  function Ragas({ ragas }) { if (!ragas) return null; const text = ragas.status === "pending" ? "Computing scores in the background…" : ragas.status === "failed" ? `Scoring failed: ${ragas.error || "provider error"}` : ragas.status === "skipped" ? `Skipped: ${ragas.reason || "retrieval context was unavailable"}` : ragas.status === "unavailable" ? `Unavailable: ${ragas.error || "the scoring task was lost"}` : ragas.status === "completed_no_scores" ? (ragas.error || "Completed without metric values") : Object.entries(ragas.scores || {}).map(([key, value]) => `${key}: ${typeof value === "number" ? value.toFixed(3) : value}`).join(" · ") || "Completed without scores"; return <section className="result-card receipt" aria-label="RAGAS retrieval quality"><span className="panel-kicker">Retrieval quality (RAGAS)</span><p>{text}</p></section>; }
33
 
34
  function App() {
35
+ const [activeTab, setActiveTab] = useState("review");
36
  const [repo, setRepo] = useState(""); const [pr, setPr] = useState(""); const [endpoint, setEndpoint] = useState("auto"); const [provider, setProvider] = useState(""); const [model, setModel] = useState(""); const [apiKey, setApiKey] = useState(""); const [baseUrl, setBaseUrl] = useState("");
37
  const [savedProviders, setSavedProviders] = useState(() => { try { return JSON.parse(localStorage.getItem("ocr-providers") || "[]"); } catch { return []; } });
38
  const [theme, setTheme] = useState(() => localStorage.getItem("ocr-theme") || "light"); const [job, setJob] = useState(null); const [message, setMessage] = useState(""); const [error, setError] = useState(""); const [busy, setBusy] = useState(false); const [user, setUser] = useState(null);