"use client"; import { useState } from "react"; import { buttonVariants } from "@/components/ui/button"; import type { DoctorReport } from "@/lib/tool-types"; import { fmtGB } from "@/lib/dashboard"; import { fmtAgo } from "@/lib/format"; // Tools, disk, index. The tool list is the CACHE handed down by the page, or // "not checked": the page never probes. The button POSTs, which is the one // place a probe happens in the app. // // Red ONLY when the report pipeline needs it and it is absent. A missing python // on a machine that never cuts a face is a fact, not a fault. export default function ToolsPanel({ initial, freeBytes, index, }: { initial: DoctorReport | null; freeBytes: number | null; index: { ok: boolean; fresh: number; total: number }; }) { const [report, setReport] = useState(initial); const [busy, setBusy] = useState(false); return (

tools & disk

{report ? `checked ${fmtAgo(report.checkedAt)}` : "not checked"}
{report && ( )}
free {fmtGB(freeBytes)} index{" "} {index.ok ? ( <> {index.fresh}/{index.total} fresh ) : ( "off" )}
); }