{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "v-popover-15",
  "description": "System Status",
  "registryDependencies": [
    "@cnippet/popover"
  ],
  "files": [
    {
      "path": "registry/default/variants/v-popover-15.tsx",
      "content": "// title: System Status\nimport { Badge } from \"@/registry/default/ui/badge\";\nimport { Button } from \"@/registry/default/ui/button\";\nimport {\n  Popover,\n  PopoverContent,\n  PopoverTrigger,\n} from \"@/registry/default/ui/popover\";\n\ntype Status = \"degraded\" | \"operational\" | \"outage\";\n\nconst services: { latency: string; name: string; status: Status }[] = [\n  { latency: \"42ms\", name: \"API Gateway\", status: \"operational\" },\n  { latency: \"8ms\", name: \"Database\", status: \"operational\" },\n  { latency: \"12ms\", name: \"CDN\", status: \"operational\" },\n  { latency: \"340ms\", name: \"Auth Service\", status: \"degraded\" },\n  { latency: \"91ms\", name: \"Storage\", status: \"operational\" },\n];\n\nconst statusConfig: Record<Status, { dot: string; label: string }> = {\n  degraded: { dot: \"bg-warning\", label: \"Degraded\" },\n  operational: { dot: \"bg-success\", label: \"Operational\" },\n  outage: { dot: \"bg-destructive\", label: \"Outage\" },\n};\n\nconst allOperational = services.every((s) => s.status === \"operational\");\n\nexport function Pattern() {\n  return (\n    <div className=\"flex min-h-25 items-center justify-center\">\n      <Popover>\n        <PopoverTrigger render={<Button variant=\"outline\" />}>\n          <span\n            className={`size-2 animate-pulse rounded-full ${allOperational ? \"bg-success\" : \"bg-warning\"}`}\n          />\n          System Status\n        </PopoverTrigger>\n        <PopoverContent align=\"center\" className=\"w-72 gap-0 p-0\">\n          <div className=\"border-b px-0 py-3\">\n            <div className=\"flex items-center justify-between\">\n              <h4 className=\"font-semibold text-sm\">System Status</h4>\n              <Badge\n                className=\"text-xs\"\n                variant={allOperational ? \"default\" : \"outline\"}\n              >\n                {allOperational ? \"All Operational\" : \"Issues Detected\"}\n              </Badge>\n            </div>\n            <p className=\"mt-0.5 text-muted-foreground text-xs\">\n              Real-time service health.\n            </p>\n          </div>\n          <div className=\"divide-y\">\n            {services.map(({ name, status, latency }) => {\n              const cfg = statusConfig[status];\n              return (\n                <div className=\"flex items-center gap-3 px-2 py-2.5\" key={name}>\n                  <span className={`size-2 shrink-0 rounded-full ${cfg.dot}`} />\n                  <span className=\"flex-1 text-sm\">{name}</span>\n                  <span className=\"text-muted-foreground text-xs tabular-nums\">\n                    {latency}\n                  </span>\n                  <span className=\"w-20 text-right text-muted-foreground text-xs\">\n                    {cfg.label}\n                  </span>\n                </div>\n              );\n            })}\n          </div>\n          <div className=\"border-t px-0 py-2.5\">\n            <p className=\"text-muted-foreground text-xs\">\n              Last checked{\" \"}\n              <span className=\"font-medium text-foreground\">just now</span>.\n            </p>\n          </div>\n        </PopoverContent>\n      </Popover>\n    </div>\n  );\n}\n",
      "type": "registry:block"
    }
  ],
  "meta": {
    "className": ""
  },
  "categories": [
    "popover"
  ],
  "type": "registry:block"
}