import { Link } from "react-router-dom"; import { AlertTriangle, AlertCircle, CheckCircle2, ServerOff, HeartPulse, ArrowUpCircle, HardDrive, MemoryStick, Archive, ChevronRight, } from "lucide-react"; import type { AttentionItem } from "@/api/dashboard"; import { cn } from "@/lib/utils"; const KIND_ICON: Record> = { agent_offline: ServerOff, unhealthy: HeartPulse, stack_error: AlertTriangle, stack_partial: AlertCircle, updates: ArrowUpCircle, disk_pressure: HardDrive, mem_pressure: MemoryStick, backup_failed: Archive, backup_overdue: Archive, }; export function AttentionStrip({ items, loading, }: { items?: AttentionItem[]; loading: boolean; }) { if (loading) { return (
); } if (!items || items.length === 0) { return (

All systems healthy — nothing needs your attention.

); } const errors = items.filter((i) => i.severity === "error").length; return (

Needs attention

0 ? "bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300" : "bg-yellow-100 text-yellow-700 dark:bg-yellow-900/40 dark:text-yellow-300" )} > {items.length}
    {items.map((item, i) => { const Icon = KIND_ICON[item.kind] ?? AlertCircle; const isError = item.severity === "error"; return (
  • {item.title}

    {item.detail && (

    {item.detail}

    )}
  • ); })}
); }