{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "host-map",
  "type": "registry:component",
  "title": "Host map",
  "description": "A dense fleet map with one cell per host, colored by load or health and grouped by region, so hot spots stand out at a glance.",
  "categories": [
    "operations"
  ],
  "dependencies": [],
  "registryDependencies": [],
  "files": [
    {
      "path": "src/registry/overtrue/host-map.tsx",
      "type": "registry:component",
      "target": "components/overtrue/host-map.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nexport type HostStatus = \"ok\" | \"warn\" | \"critical\" | \"offline\";\n\nexport interface HostMapHost {\n  id: string;\n  name: string;\n  /** Region, cluster, or zone. Hosts sharing a group are drawn together. */\n  group?: string;\n  /** Metric as a 0–1 fraction, e.g. CPU utilisation. */\n  value?: number;\n  /** Explicit health. When omitted it is derived from `value` and `thresholds`. */\n  status?: HostStatus;\n}\n\nexport interface HostMapThresholds {\n  /** Values at or above this run warm. */\n  warn: number;\n  /** Values at or above this read as critical. */\n  critical: number;\n}\n\nexport interface HostMapProps extends Omit<\n  React.ComponentProps<\"div\">,\n  \"title\" | \"onSelect\"\n> {\n  hosts: HostMapHost[];\n  /** Color cells by metric value or by health status. */\n  colorBy?: \"value\" | \"status\";\n  /** Name of the metric, e.g. \"CPU\". */\n  metricLabel?: string;\n  /** Formats a 0–1 metric value. Defaults to a whole percent. */\n  valueFormatter?: (value: number) => string;\n  title?: React.ReactNode;\n  description?: React.ReactNode;\n  /** Controls placed under the heading, such as a metric picker. */\n  actions?: React.ReactNode;\n  cellSize?: \"sm\" | \"md\";\n  /** Where cells turn warm and critical, and how status is derived from value. */\n  thresholds?: HostMapThresholds;\n  /** Order groups explicitly. Unlisted groups follow in order of appearance. */\n  groupOrder?: string[];\n  /** Mark one host as selected. Pass null for none to expose pressed state. */\n  selectedId?: string | null;\n  /** Called when a host is clicked or activated with Enter or Space. */\n  onSelect?: (host: HostMapHost) => void;\n  showLegend?: boolean;\n  /** Noun for one cell, used in counts and labels. */\n  unit?: [singular: string, plural: string];\n}\n\nconst statusLabel: Record<HostStatus, string> = {\n  ok: \"Healthy\",\n  warn: \"Warning\",\n  critical: \"Critical\",\n  offline: \"Offline\",\n};\n\nconst statusOrder: HostStatus[] = [\"ok\", \"warn\", \"critical\", \"offline\"];\n\nconst statusFill: Record<HostStatus, string> = {\n  ok: \"bg-emerald-500/65 dark:bg-emerald-500/55\",\n  warn: \"bg-amber-400 dark:bg-amber-400/90\",\n  critical: \"bg-destructive\",\n  offline: \"border border-dashed border-muted-foreground/45 bg-transparent\",\n};\n\nconst statusDot: Record<HostStatus, string> = {\n  ok: \"bg-emerald-500\",\n  warn: \"bg-amber-400\",\n  critical: \"bg-destructive\",\n  offline: \"border border-dashed border-muted-foreground/60\",\n};\n\nconst statusText: Record<HostStatus, string> = {\n  ok: \"text-emerald-700 dark:text-emerald-400\",\n  warn: \"text-amber-700 dark:text-amber-400\",\n  critical: \"text-destructive\",\n  offline: \"text-muted-foreground\",\n};\n\nconst AMBER = \"var(--color-amber-400, oklch(82.8% 0.189 84.429))\";\n\nfunction defaultValueFormatter(value: number) {\n  return `${Math.round(value * 100)}%`;\n}\n\nfunction clamp01(value: number) {\n  return Math.min(1, Math.max(0, value));\n}\n\nfunction metricOf(host: HostMapHost) {\n  return host.value != null && Number.isFinite(host.value) ? host.value : null;\n}\n\n/**\n * Calm values ramp up the chart color; warm values move from amber towards the\n * destructive color so hot spots read before any label is checked.\n */\nfunction valueFill(value: number, warn: number, critical: number) {\n  const v = clamp01(value);\n  if (v >= critical) return \"var(--color-destructive)\";\n  if (v >= warn) {\n    const t = (v - warn) / (critical - warn || 1);\n    return `color-mix(in oklab, var(--color-destructive) ${Math.round(t * 45)}%, ${AMBER})`;\n  }\n  const t = v / (warn || 1);\n  return `color-mix(in oklab, var(--color-chart-1) ${Math.round(12 + t * 66)}%, var(--color-muted))`;\n}\n\nfunction statusOf(host: HostMapHost, warn: number, critical: number): HostStatus {\n  if (host.status) return host.status;\n  const value = metricOf(host);\n  if (value == null) return \"offline\";\n  if (value >= critical) return \"critical\";\n  if (value >= warn) return \"warn\";\n  return \"ok\";\n}\n\n/**\n * Find the cell to move to with the arrow keys, following the visual layout across\n * wrapped rows and groups. Offsets ignore the hover scale transform.\n */\nfunction neighbor(\n  cells: HTMLElement[],\n  from: HTMLElement,\n  direction: \"up\" | \"down\",\n) {\n  const top = from.offsetTop;\n  const cx = from.offsetLeft + from.offsetWidth / 2;\n  const below = direction === \"down\";\n  let rowTop: number | null = null;\n  for (const cell of cells) {\n    const ahead = below ? cell.offsetTop > top + 1 : cell.offsetTop < top - 1;\n    if (!ahead) continue;\n    if (\n      rowTop == null ||\n      (below ? cell.offsetTop < rowTop - 1 : cell.offsetTop > rowTop + 1)\n    )\n      rowTop = cell.offsetTop;\n  }\n  if (rowTop == null) return null;\n  let best: HTMLElement | null = null;\n  let bestDistance = Infinity;\n  for (const cell of cells) {\n    if (Math.abs(cell.offsetTop - rowTop) > 1) continue;\n    const distance = Math.abs(cell.offsetLeft + cell.offsetWidth / 2 - cx);\n    if (distance < bestDistance) {\n      best = cell;\n      bestDistance = distance;\n    }\n  }\n  return best;\n}\n\ninterface HostCellProps {\n  host: HostMapHost;\n  status: HostStatus;\n  fill: string | undefined;\n  label: string;\n  active: boolean;\n  selected: boolean | undefined;\n  dimmed: boolean;\n  tabStop: boolean;\n  selectable: boolean;\n  onHover: (id: string) => void;\n  onFocusCell: (id: string) => void;\n  onSelect?: (host: HostMapHost) => void;\n}\n\n/** Memoised so hovering one cell does not re-render a fleet of hundreds. */\nconst HostCell = React.memo(function HostCell({\n  host,\n  status,\n  fill,\n  label,\n  active,\n  selected,\n  dimmed,\n  tabStop,\n  selectable,\n  onHover,\n  onFocusCell,\n  onSelect,\n}: HostCellProps) {\n  return (\n    <button\n      type=\"button\"\n      data-slot=\"host-map-cell\"\n      data-id={host.id}\n      data-status={status}\n      data-active={active || undefined}\n      data-selected={selected || undefined}\n      aria-label={label}\n      aria-pressed={selected}\n      tabIndex={tabStop ? 0 : -1}\n      onPointerEnter={() => onHover(host.id)}\n      onFocus={() => onFocusCell(host.id)}\n      onClick={onSelect ? () => onSelect(host) : undefined}\n      className={cn(\n        \"relative size-(--host-cell) rounded-[3px] outline-none\",\n        \"transition-[transform,opacity,background-color,box-shadow] duration-150 ease-out motion-reduce:transition-none\",\n        fill ? \"\" : statusFill[status],\n        dimmed && \"opacity-20\",\n        selectable ? \"cursor-pointer\" : \"cursor-default\",\n        \"data-[active]:z-10 data-[active]:scale-[1.35] data-[active]:ring-2 data-[active]:ring-foreground/85 data-[active]:ring-offset-1 data-[active]:ring-offset-card\",\n        \"focus-visible:z-10 focus-visible:scale-[1.35] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-card\",\n        \"data-[selected]:ring-2 data-[selected]:ring-primary data-[selected]:ring-offset-1 data-[selected]:ring-offset-card\",\n        status === \"critical\" &&\n          !dimmed &&\n          \"after:pointer-events-none after:absolute after:-inset-[3px] after:rounded-[5px] after:border after:border-destructive/70 after:opacity-0 motion-safe:after:animate-[host-map-pulse_2.4s_ease-out_infinite]\",\n      )}\n      style={fill ? { backgroundColor: fill } : undefined}\n    />\n  );\n});\n\n/**\n * A fleet host map: one small cell per host, pod, or node, colored by a metric or by\n * health and grouped by region. Hover or focus a cell to inspect it in a fixed readout;\n * arrow keys move through the map and Enter selects.\n */\nfunction HostMap({\n  hosts,\n  colorBy = \"value\",\n  metricLabel = \"Load\",\n  valueFormatter = defaultValueFormatter,\n  title,\n  description,\n  actions,\n  cellSize = \"md\",\n  thresholds,\n  groupOrder,\n  selectedId,\n  onSelect,\n  showLegend = true,\n  unit = [\"host\", \"hosts\"],\n  className,\n  ...props\n}: HostMapProps) {\n  const warn = thresholds?.warn ?? 0.7;\n  const critical = thresholds?.critical ?? 0.9;\n  const mapRef = React.useRef<HTMLDivElement>(null);\n  const [hoveredId, setHoveredId] = React.useState<string | null>(null);\n  const [focusedId, setFocusedId] = React.useState<string | null>(null);\n  const [tabStopId, setTabStopId] = React.useState<string | null>(null);\n  const [isolated, setIsolated] = React.useState<HostStatus | null>(null);\n\n  const onFocusCell = React.useCallback((id: string) => {\n    setFocusedId(id);\n    setTabStopId(id);\n  }, []);\n\n  const groups = React.useMemo(() => {\n    const map = new Map<string, HostMapHost[]>();\n    for (const name of groupOrder ?? []) map.set(name, []);\n    for (const host of hosts) {\n      const key = host.group ?? \"\";\n      if (!map.has(key)) map.set(key, []);\n      map.get(key)!.push(host);\n    }\n    return [...map.entries()]\n      .filter(([, members]) => members.length > 0)\n      .map(([name, members]) => {\n        const counts = { ok: 0, warn: 0, critical: 0, offline: 0 };\n        let sum = 0;\n        let measured = 0;\n        for (const host of members) {\n          const status = statusOf(host, warn, critical);\n          counts[status] += 1;\n          const value = metricOf(host);\n          if (status !== \"offline\" && value != null) {\n            sum += value;\n            measured += 1;\n          }\n        }\n        return {\n          name,\n          hosts: members,\n          counts,\n          sum,\n          measured,\n          average: measured ? sum / measured : null,\n        };\n      });\n  }, [hosts, groupOrder, warn, critical]);\n\n  const fleet = React.useMemo(() => {\n    const counts = { ok: 0, warn: 0, critical: 0, offline: 0 };\n    let sum = 0;\n    let measured = 0;\n    for (const group of groups) {\n      for (const status of statusOrder) counts[status] += group.counts[status];\n      sum += group.sum;\n      measured += group.measured;\n    }\n    return { counts, average: measured ? sum / measured : null };\n  }, [groups]);\n\n  const ordered = React.useMemo(\n    () => groups.flatMap((group) => group.hosts),\n    [groups],\n  );\n  const grouped = groups.length > 1 || (groups[0]?.name ?? \"\") !== \"\";\n\n  const activeId = hoveredId ?? focusedId;\n  const activeHost = activeId\n    ? (hosts.find((host) => host.id === activeId) ?? null)\n    : null;\n  const stopId =\n    tabStopId && ordered.some((host) => host.id === tabStopId)\n      ? tabStopId\n      : (ordered[0]?.id ?? null);\n\n  const plural = (n: number) => (n === 1 ? unit[0] : unit[1]);\n  const { counts } = fleet;\n  const attention =\n    counts.warn + counts.critical + (colorBy === \"status\" ? counts.offline : 0);\n\n  const onKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n    const target = event.target as HTMLElement;\n    if (target.dataset.slot !== \"host-map-cell\") return;\n    const all = Array.from(\n      event.currentTarget.querySelectorAll<HTMLElement>(\n        '[data-slot=\"host-map-cell\"]',\n      ),\n    );\n    const index = all.indexOf(target);\n    const moves: Record<string, () => HTMLElement | null | undefined> = {\n      ArrowRight: () => all[index + 1],\n      ArrowLeft: () => all[index - 1],\n      ArrowDown: () => neighbor(all, target, \"down\"),\n      ArrowUp: () => neighbor(all, target, \"up\"),\n      Home: () => all[0],\n      End: () => all[all.length - 1],\n    };\n    const move = moves[event.key];\n    if (!move) return;\n    event.preventDefault();\n    const next = move();\n    if (!next) return;\n    setTabStopId(next.dataset.id ?? null);\n    next.focus();\n  };\n\n  const describe = (host: HostMapHost, status: HostStatus) => {\n    const parts = [host.name];\n    if (host.group) parts.push(host.group);\n    const value = metricOf(host);\n    if (value != null && status !== \"offline\")\n      parts.push(`${metricLabel} ${valueFormatter(value)}`);\n    parts.push(statusLabel[status]);\n    return parts.join(\", \");\n  };\n\n  const hasHeader = title != null || description != null || actions != null;\n  const mapLabel = typeof title === \"string\" ? title : \"Host map\";\n\n  let readout: React.ReactNode;\n  if (activeHost) {\n    const status = statusOf(activeHost, warn, critical);\n    const value = status === \"offline\" ? null : metricOf(activeHost);\n    readout = (\n      <>\n        <div className=\"flex min-w-0 items-center gap-2\">\n          <span\n            aria-hidden=\"true\"\n            className={cn(\"size-2 shrink-0 rounded-full\", statusDot[status])}\n          />\n          <span className=\"truncate font-mono text-xs font-medium text-foreground\">\n            {activeHost.name}\n          </span>\n          {activeHost.group ? (\n            <span className=\"ml-auto shrink-0 font-mono text-[10.5px] text-muted-foreground\">\n              {activeHost.group}\n            </span>\n          ) : null}\n        </div>\n        <div className=\"flex items-center gap-2.5\">\n          <span className=\"text-[11px] text-muted-foreground\">\n            {metricLabel}\n          </span>\n          <span className=\"text-sm font-semibold tabular-nums\">\n            {value != null ? valueFormatter(value) : \"—\"}\n          </span>\n          <span className=\"relative h-1 min-w-8 flex-1 overflow-hidden rounded-full bg-muted\">\n            {value != null ? (\n              <span\n                className=\"absolute inset-y-0 left-0 rounded-full\"\n                style={{\n                  width: `${clamp01(value) * 100}%`,\n                  background: valueFill(value, warn, critical),\n                }}\n              />\n            ) : null}\n          </span>\n          <span className={cn(\"text-xs font-medium\", statusText[status])}>\n            {statusLabel[status]}\n          </span>\n        </div>\n      </>\n    );\n  } else {\n    readout = (\n      <>\n        <div className=\"flex items-center gap-2 text-xs text-muted-foreground\">\n          <span className=\"text-[11px] font-medium\">\n            Fleet\n          </span>\n          <span className=\"ml-auto tabular-nums\">\n            {hosts.length} {plural(hosts.length)}\n          </span>\n        </div>\n        <div className=\"flex items-center gap-3 text-xs\">\n          <span className=\"flex items-baseline gap-1.5\">\n            <span className=\"text-muted-foreground\">\n              {colorBy === \"value\" ? `avg ${metricLabel}` : \"healthy\"}\n            </span>\n            <span className=\"text-sm font-semibold tabular-nums\">\n              {colorBy === \"value\"\n                ? fleet.average != null\n                  ? valueFormatter(fleet.average)\n                  : \"—\"\n                : counts.ok}\n            </span>\n          </span>\n          <span className=\"flex items-baseline gap-1.5\">\n            <span className=\"text-muted-foreground\">\n              {colorBy === \"value\" ? \"hot\" : \"need attention\"}\n            </span>\n            <span\n              className={cn(\n                \"text-sm font-semibold tabular-nums\",\n                counts.critical > 0\n                  ? \"text-destructive\"\n                  : attention > 0\n                    ? \"text-amber-700 dark:text-amber-400\"\n                    : \"text-foreground\",\n              )}\n            >\n              {attention}\n            </span>\n          </span>\n        </div>\n      </>\n    );\n  }\n\n  return (\n    <div\n      data-slot=\"host-map\"\n      data-color-by={colorBy}\n      className={cn(\n        \"@container/host-map flex min-w-0 flex-col rounded-xl border bg-card text-card-foreground shadow-xs\",\n        className,\n      )}\n      {...props}\n    >\n      <div\n        className={cn(\n          \"flex flex-col gap-3 px-5 pt-5 @md/host-map:flex-row @md/host-map:items-start @md/host-map:justify-between @md/host-map:gap-6\",\n          !hasHeader && \"@md/host-map:justify-end\",\n        )}\n      >\n        {hasHeader ? (\n          <div className=\"min-w-0 space-y-1\">\n            {title != null ? (\n              <h3 className=\"text-sm leading-5 font-semibold tracking-tight\">\n                {title}\n              </h3>\n            ) : null}\n            {description != null ? (\n              <p className=\"text-xs text-muted-foreground\">{description}</p>\n            ) : null}\n            {actions != null ? (\n              <div className=\"flex items-center gap-2 pt-2\">{actions}</div>\n            ) : null}\n          </div>\n        ) : null}\n        <div\n          data-slot=\"host-map-readout\"\n          aria-hidden=\"true\"\n          data-active={activeHost ? true : undefined}\n          className=\"flex min-w-0 shrink-0 flex-col justify-center gap-1.5 rounded-lg bg-muted/50 px-3 py-2 transition-colors data-[active]:bg-muted motion-reduce:transition-none @md/host-map:w-56 dark:bg-muted/30 dark:data-[active]:bg-muted/60\"\n        >\n          {readout}\n        </div>\n      </div>\n\n      <div\n        ref={mapRef}\n        role=\"group\"\n        aria-label={`${mapLabel}: ${hosts.length} ${plural(hosts.length)}. Use the arrow keys to move between them.`}\n        onKeyDown={onKeyDown}\n        onPointerLeave={() => setHoveredId(null)}\n        onBlur={(event) => {\n          if (!event.currentTarget.contains(event.relatedTarget as Node))\n            setFocusedId(null);\n        }}\n        className=\"flex flex-col gap-4 p-5\"\n        style={\n          {\n            \"--host-cell\": cellSize === \"sm\" ? \"10px\" : \"14px\",\n            \"--host-gap\": cellSize === \"sm\" ? \"2px\" : \"3px\",\n          } as React.CSSProperties\n        }\n      >\n        {hosts.length === 0 ? (\n          <p className=\"py-6 text-center text-xs text-muted-foreground\">\n            No {unit[1]} to show.\n          </p>\n        ) : null}\n        {groups.map((group) => {\n          const groupActive =\n            activeHost != null && (activeHost.group ?? \"\") === group.name;\n          const groupHot = group.counts.warn + group.counts.critical;\n          return (\n            <div\n              key={group.name || \"_\"}\n              role={grouped ? \"group\" : undefined}\n              aria-label={\n                grouped\n                  ? `${group.name}, ${group.hosts.length} ${plural(group.hosts.length)}`\n                  : undefined\n              }\n              className=\"flex min-w-0 flex-col gap-2\"\n            >\n              {grouped ? (\n                <div\n                  aria-hidden=\"true\"\n                  data-slot=\"host-map-group-header\"\n                  className=\"flex items-baseline gap-2 text-[11px]\"\n                >\n                  <span\n                    className={cn(\n                      \"font-mono font-medium transition-colors motion-reduce:transition-none\",\n                      groupActive ? \"text-foreground\" : \"text-foreground/80\",\n                    )}\n                  >\n                    {group.name}\n                  </span>\n                  <span className=\"text-muted-foreground tabular-nums\">\n                    {group.hosts.length}\n                  </span>\n                  <span className=\"h-px min-w-4 flex-1 self-center bg-border\" />\n                  <span className=\"flex items-baseline gap-2.5 text-muted-foreground tabular-nums\">\n                    {colorBy === \"value\" ? (\n                      <>\n                        {group.average != null ? (\n                          <span>\n                            avg{\" \"}\n                            <span className=\"font-medium text-foreground\">\n                              {valueFormatter(group.average)}\n                            </span>\n                          </span>\n                        ) : null}\n                        {groupHot > 0 ? (\n                          <span\n                            className={\n                              group.counts.critical > 0\n                                ? \"text-destructive\"\n                                : \"text-amber-700 dark:text-amber-400\"\n                            }\n                          >\n                            {groupHot} hot\n                          </span>\n                        ) : null}\n                      </>\n                    ) : (\n                      statusOrder\n                        .filter(\n                          (status) =>\n                            status !== \"ok\" && group.counts[status] > 0,\n                        )\n                        .map((status) => (\n                          <span key={status} className={statusText[status]}>\n                            {group.counts[status]}{\" \"}\n                            {status === \"warn\" ? \"warn\" : status}\n                          </span>\n                        ))\n                    )}\n                  </span>\n                </div>\n              ) : null}\n              <div\n                className=\"grid\"\n                style={{\n                  gap: \"var(--host-gap)\",\n                  gridTemplateColumns: \"repeat(auto-fill, var(--host-cell))\",\n                }}\n              >\n                {group.hosts.map((host) => {\n                  const status = statusOf(host, warn, critical);\n                  const value = metricOf(host);\n                  return (\n                    <HostCell\n                      key={host.id}\n                      host={host}\n                      status={status}\n                      fill={\n                        colorBy === \"value\" && status !== \"offline\" && value != null\n                          ? valueFill(value, warn, critical)\n                          : undefined\n                      }\n                      label={describe(host, status)}\n                      active={host.id === activeId}\n                      selected={\n                        selectedId === undefined\n                          ? undefined\n                          : host.id === selectedId\n                      }\n                      dimmed={isolated != null && status !== isolated}\n                      tabStop={host.id === stopId}\n                      selectable={onSelect != null}\n                      onHover={setHoveredId}\n                      onFocusCell={onFocusCell}\n                      onSelect={onSelect}\n                    />\n                  );\n                })}\n              </div>\n            </div>\n          );\n        })}\n      </div>\n\n      {showLegend ? (\n        <div\n          data-slot=\"host-map-legend\"\n          className=\"flex flex-wrap items-center justify-between gap-x-6 gap-y-2 border-t px-5 py-3 text-[11px] text-muted-foreground\"\n        >\n          {colorBy === \"value\" ? (\n            <>\n              <span className=\"text-[11px] font-medium\">\n                {metricLabel}\n              </span>\n              <span className=\"flex items-center gap-4\">\n                <span className=\"flex flex-col gap-1\">\n                  <span\n                    aria-hidden=\"true\"\n                    className=\"flex h-2 w-40 overflow-hidden rounded-full\"\n                  >\n                    <span\n                      className=\"h-full\"\n                      style={{\n                        width: `${warn * 100}%`,\n                        background: `linear-gradient(to right, ${valueFill(0, warn, critical)}, ${valueFill(warn - 0.001, warn, critical)})`,\n                      }}\n                    />\n                    <span\n                      className=\"h-full\"\n                      style={{\n                        width: `${(critical - warn) * 100}%`,\n                        background: `linear-gradient(to right, ${valueFill(warn, warn, critical)}, ${valueFill(critical - 0.001, warn, critical)})`,\n                      }}\n                    />\n                    <span\n                      className=\"h-full flex-1\"\n                      style={{ background: valueFill(1, warn, critical) }}\n                    />\n                  </span>\n                  <span className=\"relative h-3 w-40 font-mono text-[10px] tabular-nums\">\n                    <span className=\"absolute left-0\">{valueFormatter(0)}</span>\n                    <span\n                      className=\"absolute -translate-x-1/2\"\n                      style={{ left: `${warn * 100}%` }}\n                    >\n                      {valueFormatter(warn)}\n                    </span>\n                    <span\n                      className=\"absolute -translate-x-1/2\"\n                      style={{ left: `${critical * 100}%` }}\n                    >\n                      {valueFormatter(critical)}\n                    </span>\n                  </span>\n                </span>\n                <span className=\"flex items-center gap-1.5\">\n                  <span\n                    aria-hidden=\"true\"\n                    className=\"size-2.5 rounded-[2px] border border-dashed border-muted-foreground/60\"\n                  />\n                  Offline\n                </span>\n              </span>\n            </>\n          ) : (\n            <div\n              role=\"group\"\n              aria-label={`Highlight ${unit[1]} by status`}\n              className=\"flex flex-wrap items-center gap-1\"\n            >\n              {statusOrder.map((status) => (\n                <button\n                  key={status}\n                  type=\"button\"\n                  aria-pressed={isolated === status}\n                  onClick={() =>\n                    setIsolated((current) =>\n                      current === status ? null : status,\n                    )\n                  }\n                  className={cn(\n                    \"inline-flex h-7 items-center gap-1.5 rounded-md border border-transparent px-2 text-xs transition-colors outline-none hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring/50 motion-reduce:transition-none\",\n                    \"aria-pressed:border-border aria-pressed:bg-muted aria-pressed:text-foreground\",\n                  )}\n                >\n                  <span\n                    aria-hidden=\"true\"\n                    className={cn(\"size-2.5 rounded-[2px]\", statusFill[status])}\n                  />\n                  <span>{statusLabel[status]}</span>\n                  <span className=\"font-medium text-foreground tabular-nums\">\n                    {counts[status]}\n                  </span>\n                </button>\n              ))}\n            </div>\n          )}\n        </div>\n      ) : null}\n\n      <style href=\"overtrue-host-map\" precedence=\"default\">\n        {`@keyframes host-map-pulse{0%{opacity:.9;transform:scale(.85)}70%,100%{opacity:0;transform:scale(1.25)}}`}\n      </style>\n    </div>\n  );\n}\n\nexport { HostMap };\n"
    }
  ],
  "docs": "Documentation: https://ui.overtrue.xyz/components/host-map. Requires an initialized shadcn/ui project with Tailwind CSS v4."
}
