{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "agent-microphone-button",
  "type": "registry:ui",
  "description": "Toggle button for muting/unmuting the microphone",
  "files": [
    {
      "path": "components/ui/AgentMicrophoneButton.tsx",
      "content": "import { useAgentMicrophone } from \"@deepgram/react\";\nimport { Toggle } from \"@/components/ui/toggle\";\nimport { Button } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface AgentMicrophoneButtonProps {\n  className?: string;\n  activeLabel?: React.ReactNode;\n  mutedLabel?: React.ReactNode;\n  disabledLabel?: React.ReactNode;\n  onClick?: () => void;\n}\n\nconst MicIcon = () => (\n  <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={2} strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n    <path d=\"M12 2a3 3 0 0 1 3 3v7a3 3 0 0 1-6 0V5a3 3 0 0 1 3-3Z\" />\n    <path d=\"M19 10v2a7 7 0 0 1-14 0v-2\" />\n    <line x1=\"12\" x2=\"12\" y1=\"19\" y2=\"22\" />\n  </svg>\n);\nconst MicOffIcon = () => (\n  <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={2} strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n    <line x1=\"2\" x2=\"22\" y1=\"2\" y2=\"22\" />\n    <path d=\"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2\" />\n    <path d=\"M5 10v2a7 7 0 0 0 12 5\" />\n    <path d=\"M15 9.34V5a3 3 0 0 0-5.68-1.33\" />\n    <path d=\"M9 9v3a3 3 0 0 0 5.12 2.12\" />\n    <line x1=\"12\" x2=\"12\" y1=\"19\" y2=\"22\" />\n  </svg>\n);\n\nconst toggleClasses = cn(\n  \"dg:h-10 dg:w-10 dg:shrink-0 dg:rounded-[calc(var(--radius)-6px)] dg:border dg:border-border dg:bg-card dg:text-foreground\",\n  \"dg:hover:bg-accent dg:hover:text-accent-foreground\",\n  \"dg:data-[state=on]:bg-primary dg:data-[state=on]:text-primary-foreground dg:data-[state=on]:border-primary\",\n  \"dg:data-[state=on]:hover:bg-[var(--primary-hover)]\",\n  \"dg:data-[state=off]:text-muted-foreground\",\n);\n\nexport function AgentMicrophoneButton({\n  className,\n  activeLabel  = <MicIcon />,\n  mutedLabel   = <MicOffIcon />,\n  disabledLabel,\n  onClick,\n}: AgentMicrophoneButtonProps) {\n  const { micMuted, micActive, toggle, enabled } = useAgentMicrophone();\n\n  if (!enabled) {\n    return disabledLabel ? (\n      <Button\n        variant=\"outline\"\n        size=\"icon\"\n        disabled\n        className={cn(toggleClasses, className)}\n        data-agent-mic-button\n        data-state=\"disabled\"\n        aria-label=\"Microphone unavailable\"\n      >\n        {disabledLabel}\n      </Button>\n    ) : null;\n  }\n\n  const label = micMuted ? mutedLabel : activeLabel;\n  const state = !micActive ? \"inactive\" : micMuted ? \"muted\" : \"active\";\n\n  return (\n    <Toggle\n      pressed={!micMuted}\n      onPressedChange={() => { toggle(); onClick?.(); }}\n      aria-label={typeof label === \"string\" ? label : \"Microphone\"}\n      data-agent-mic-button\n      data-state={state}\n      className={cn(toggleClasses, className)}\n    >\n      {label}\n    </Toggle>\n  );\n}\n",
      "type": "registry:ui",
      "target": ""
    }
  ],
  "dependencies": [
    "@deepgram/react"
  ],
  "registryDependencies": [
    "utils",
    "button",
    "toggle"
  ]
}
