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:
@@ -1,5 +1,6 @@
|
||||
import { useParams, Link } from "react-router-dom"
|
||||
import { Clock, Package } from "lucide-react"
|
||||
import { Clock } from "lucide-react"
|
||||
import { kindIcon } from "@/lib/labels"
|
||||
import { useJob } from "@/services/api/hooks"
|
||||
import { LogViewer } from "@/components/LogViewer"
|
||||
import { DetailHeader } from "@/components/detail/DetailHeader"
|
||||
@@ -8,6 +9,8 @@ import { SystemdPanel } from "@/components/detail/SystemdPanel"
|
||||
import { ConfigPanel } from "@/components/detail/ConfigPanel"
|
||||
import { RelatedDeployments } from "@/components/detail/RelatedDeployments"
|
||||
|
||||
const ProgramIcon = kindIcon("program")
|
||||
|
||||
export function ScheduledDetailPage() {
|
||||
const { name } = useParams<{ name: string }>()
|
||||
const { data: deployment, isLoading, error, refetch } = useJob(name ?? "")
|
||||
@@ -58,7 +61,7 @@ export function ScheduledDetailPage() {
|
||||
to={`/programs/${deployment.program}`}
|
||||
className="flex items-center gap-1.5 min-w-0 text-[var(--primary)] hover:underline"
|
||||
>
|
||||
<Package size={14} className="shrink-0" /> {deployment.program}
|
||||
<ProgramIcon size={14} className="shrink-0" /> {deployment.program}
|
||||
</Link>
|
||||
</>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user