{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "uptime-history",
  "type": "registry:component",
  "title": "Uptime history",
  "description": "Availability over time, with a text alternative for every sample.",
  "categories": [
    "operations"
  ],
  "dependencies": [],
  "registryDependencies": [],
  "files": [
    {
      "path": "src/registry/overtrue/uptime-history.tsx",
      "type": "registry:component",
      "target": "components/overtrue/uptime-history.tsx",
      "content": "\"use client\";\nimport { useId, type ComponentProps } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\nexport type AvailabilityStatus =\n  \"operational\" | \"degraded\" | \"outage\" | \"unknown\";\nexport interface UptimeSample {\n  id: string;\n  label: string;\n  status: AvailabilityStatus;\n}\nconst colors: Record<AvailabilityStatus, string> = {\n  operational: \"bg-emerald-500/70\",\n  degraded: \"bg-amber-500/70\",\n  outage: \"bg-destructive\",\n  unknown: \"bg-muted-foreground/30\",\n};\nexport function UptimeHistory({\n  samples,\n  label,\n  startLabel,\n  endLabel,\n  className,\n  ...props\n}: Omit<ComponentProps<\"div\">, \"children\"> & {\n  samples: readonly UptimeSample[];\n  label: string;\n  startLabel?: string;\n  endLabel?: string;\n}) {\n  const id = useId();\n  return (\n    <div\n      data-slot=\"uptime-history\"\n      className={cn(\"min-w-0 space-y-2\", className)}\n      {...props}\n    >\n      {samples.length ? (\n        <>\n          <div\n            role=\"img\"\n            aria-label={label}\n            aria-describedby={id}\n            className=\"flex h-7 gap-0.5\"\n          >\n            {samples.map((sample) => (\n              <span\n                key={sample.id}\n                title={`${sample.label}: ${sample.status}`}\n                className={cn(\n                  \"min-w-0 flex-1 rounded-sm\",\n                  colors[sample.status],\n                )}\n              />\n            ))}\n          </div>\n          <ul id={id} className=\"sr-only\">\n            {samples.map((sample) => (\n              <li key={sample.id}>\n                {sample.label}: {sample.status}\n              </li>\n            ))}\n          </ul>\n        </>\n      ) : (\n        <p className=\"text-xs text-muted-foreground\">\n          No availability data yet.\n        </p>\n      )}\n      {(startLabel || endLabel) && (\n        <div className=\"flex justify-between gap-3 text-xs text-muted-foreground\">\n          <span>{startLabel}</span>\n          <span>{endLabel}</span>\n        </div>\n      )}\n    </div>\n  );\n}\n"
    }
  ],
  "docs": "Documentation: https://ui.overtrue.xyz/components/uptime-history. Requires an initialized shadcn/ui project with Tailwind CSS v4."
}
