{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "client-status",
  "title": "Client Status",
  "description": "Client and agent connection status rows, live-updated from transport state and bot lifecycle events.",
  "dependencies": [
    "@pipecat-ai/client-js@^1.14.0",
    "@pipecat-ai/client-react@^1.9.0",
    "lucide-react@^1.41.0"
  ],
  "files": [
    {
      "path": "src/components/client-status.tsx",
      "content": "\"use client\";\n\nimport { RTVIEvent } from \"@pipecat-ai/client-js\";\nimport {\n  usePipecatClientTransportState,\n  useRTVIClientEvent,\n} from \"@pipecat-ai/client-react\";\nimport { Loader2Icon } from \"lucide-react\";\nimport { useEffect, useState } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst CONNECTING_STATES = [\n  \"initializing\",\n  \"authenticating\",\n  \"authenticated\",\n  \"connecting\",\n];\n\nexport interface ClientStatusValueProps {\n  /** Transport-like state string to display. */\n  state?: string | null;\n  className?: string;\n}\n\n/** One status value, colored and animated by connection state. */\nexport function ClientStatusValue({\n  state,\n  className,\n}: ClientStatusValueProps) {\n  return (\n    <span\n      className={cn(\n        \"text-muted-foreground flex items-center justify-end gap-1.5 font-mono text-xs leading-none font-medium tracking-wide uppercase\",\n        {\n          \"text-active\": state === \"connected\" || state === \"ready\",\n          \"text-destructive\": state === \"error\",\n          \"text-muted-foreground/60\": state === \"disconnected\" || !state,\n          \"animate-pulse\": CONNECTING_STATES.includes(state || \"\"),\n        },\n        className,\n      )}\n    >\n      {state || \"—\"}\n      {state &&\n        [\"authenticating\", \"authenticated\", \"connecting\"].includes(state) && (\n          <Loader2Icon className=\"size-3 animate-spin\" />\n        )}\n    </span>\n  );\n}\n\nexport interface ClientStatusProps {\n  /** Hide the agent (bot) status row. */\n  noAgentState?: boolean;\n  /** Hide the client (transport) status row. */\n  noClientState?: boolean;\n  className?: string;\n}\n\n/**\n * Client and agent connection status rows, live-updated from transport\n * state and bot lifecycle events.\n * Must be rendered inside a PipecatClientProvider.\n */\nexport function ClientStatus({\n  noAgentState = false,\n  noClientState = false,\n  className,\n}: ClientStatusProps) {\n  const transportState = usePipecatClientTransportState();\n\n  const [botStatus, setBotStatus] = useState<\n    \"disconnected\" | \"connecting\" | \"connected\" | \"ready\" | null\n  >(null);\n\n  useEffect(() => {\n    if (transportState === \"connecting\") {\n      setBotStatus(\"connecting\");\n    }\n  }, [transportState]);\n\n  useRTVIClientEvent(RTVIEvent.BotReady, () => setBotStatus(\"ready\"));\n  useRTVIClientEvent(RTVIEvent.BotConnected, () => setBotStatus(\"connected\"));\n  useRTVIClientEvent(RTVIEvent.Disconnected, () =>\n    setBotStatus(\"disconnected\"),\n  );\n  useRTVIClientEvent(RTVIEvent.BotDisconnected, () =>\n    setBotStatus(\"disconnected\"),\n  );\n\n  if (noAgentState && noClientState) return null;\n\n  return (\n    <dl\n      data-slot=\"client-status\"\n      className={cn(\n        \"grid grid-cols-[auto_minmax(0,1fr)] items-center gap-2 text-sm\",\n        className,\n      )}\n    >\n      {!noClientState && (\n        <>\n          <dt className=\"text-muted-foreground\">Client</dt>\n          <dd className=\"min-w-0\">\n            <ClientStatusValue state={transportState} />\n          </dd>\n        </>\n      )}\n      {!noAgentState && (\n        <>\n          <dt className=\"text-muted-foreground\">Agent</dt>\n          <dd className=\"min-w-0\">\n            <ClientStatusValue state={botStatus} />\n          </dd>\n        </>\n      )}\n    </dl>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/pipecat/client-status.tsx"
    }
  ],
  "cssVars": {
    "theme": {
      "color-active": "var(--active-background)",
      "color-active-foreground": "var(--active-foreground)"
    },
    "light": {
      "active-background": "oklch(0.696 0.17 162.48)",
      "active-foreground": "oklch(0.979 0.021 166.113)"
    },
    "dark": {
      "active-background": "oklch(0.702 0.158 160.44)",
      "active-foreground": "oklch(0.979 0.021 166.11)"
    }
  },
  "docs": "Render inside a PipecatClientProvider.",
  "categories": [
    "voice"
  ],
  "type": "registry:component"
}