app: centralize kind→icon in one KIND_ICONS map

Every surface hand-mapped deployment kind → lucide icon, so they could (and did) drift. Add KIND_ICONS/kindIcon to lib/labels beside kindLabel, and route KindBadge (→ all detail headers/cards/sections), the Overview tiles, and the program links through it.
This commit is contained in:
2026-07-07 17:13:52 -07:00
parent 96ffa8aae7
commit 26f6b1d43c
4 changed files with 36 additions and 9 deletions

View File

@@ -1,5 +1,6 @@
import { Link } from "react-router-dom"
import { Clock, Globe, Package, Server, Share2, Wrench } from "lucide-react"
import { Globe, Share2 } from "lucide-react"
import { KIND_ICONS } from "@/lib/labels"
import {
useGateway,
useJobs,
@@ -33,28 +34,28 @@ export function Overview() {
const tiles = [
{
to: "/services",
icon: Server,
icon: KIND_ICONS.service,
label: "Services",
value: services?.length ?? 0,
detail: services ? `${upCount(serviceIds)} up` : "",
},
{
to: "/scheduled",
icon: Clock,
icon: KIND_ICONS.job,
label: "Scheduled",
value: jobs?.length ?? 0,
detail: jobs ? `${jobs.length === 1 ? "job" : "jobs"}` : "",
},
{
to: "/tools",
icon: Wrench,
icon: KIND_ICONS.tool,
label: "Tools",
value: tools?.length ?? 0,
detail: tools ? "on PATH" : "",
},
{
to: "/programs",
icon: Package,
icon: KIND_ICONS.program,
label: "Programs",
value: programs?.length ?? 0,
detail: programs ? "in catalog" : "",