import { ArrowRight, Bot, ExternalLink, GitCommit, Package, RefreshCw, Server, Shield, Shuffle, X } from "lucide-react" import { cn } from "@/lib/utils" import type { Job, UpdateDetails } from "@/lib/api" export type UpdateDetailState = { kind: "os" | "engine" | "swap" | "hermes"; loading: boolean; data: UpdateDetails | null } // Update-Detail-Fenster des SystemDrawers (Review P2-14: extrahiert): zeigt VOR dem // Anwenden, was genau aktualisiert wird (apt-Pakete, Engine-Builds, Hermes-Commits). export function UpdateDetailModal({ detail, maintenanceJob, onClose, onApply }: { detail: UpdateDetailState maintenanceJob?: Job onClose: () => void onApply: () => void }) { const d = detail.data const meta = { os: { icon: Shield, cls: "text-cyan-400", title: "OS-Pakete (apt)" }, engine: { icon: Server, cls: "text-violet-400", title: "Inferenz-Engine (llama.cpp)" }, swap: { icon: Shuffle, cls: "text-fuchsia-400", title: "Router (llama-swap)" }, hermes: { icon: Bot, cls: "text-amber-400", title: "Hermes-Agent" }, }[detail.kind] const Icon = meta.icon const nothing = !d ? true : detail.kind === "os" ? (d.count ?? 0) === 0 : detail.kind === "hermes" ? (d.behind ?? 0) === 0 : (d.installed_build != null && d.latest_build != null && d.latest_build <= d.installed_build) return (
{d.body}
)}
>
) : (
// hermes
(d?.commits?.length ?? 0) === 0 ? (
Vor dem Update wird automatisch ein Backup erstellt; danach startet der Hermes-Gateway neu.
> ) )}