import { CheckCircle2, CircleAlert, XCircle } from "lucide-react"; import type { PreflightCheck, PreflightResult } from "@/lib/preflight"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { cn } from "@/lib/utils"; function Row({ check }: { check: PreflightCheck }) { const Icon = check.ok ? CheckCircle2 : check.required ? XCircle : CircleAlert; const tone = check.ok ? "text-emerald-500" : check.required ? "text-red-500" : "text-amber-500"; return (
{check.label} {!check.required && ( optional )}

{check.detail}

{!check.ok && check.fix && (

Fix: {check.fix}

)}
); } export function PreflightPanel({ preflight }: { preflight: PreflightResult }) { const failing = preflight.checks.filter((c) => c.required && !c.ok); return ( {preflight.ready ? ( ) : ( )} Environment {preflight.ready ? "ready" : `${failing.length} required check${failing.length === 1 ? "" : "s"} failing`} {preflight.checks.map((c) => ( ))} ); }