{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"agent-disconnect-button","title":"Agent Disconnect Button","description":"A button for disconnecting the agent session.","dependencies":["@livekit/components-react@^2.0.0","class-variance-authority","lucide-react"],"registryDependencies":["button"],"files":[{"path":"components/agents-ui/agent-disconnect-button.tsx","content":"'use client';\n\nimport { type ComponentProps } from 'react';\nimport { Button, buttonVariants } from '@/components/ui/button';\nimport { cn } from '@/lib/utils';\nimport { useSessionContext } from '@livekit/components-react';\nimport { type VariantProps } from 'class-variance-authority';\nimport { PhoneOffIcon } from 'lucide-react';\n\n/**\n * Props for the AgentDisconnectButton component.\n */\nexport interface AgentDisconnectButtonProps\n  extends ComponentProps<'button'>, VariantProps<typeof buttonVariants> {\n  /**\n   * Custom icon to display. Defaults to PhoneOffIcon.\n   */\n  icon?: React.ReactNode;\n  /**\n   * The size of the button.\n   * @default 'default'\n   */\n  size?: 'default' | 'sm' | 'lg' | 'icon';\n  /**\n   * The variant of the button.\n   * @default 'destructive'\n   */\n  variant?: 'default' | 'outline' | 'destructive' | 'ghost' | 'link';\n  /**\n   * The children to render.\n   */\n  children?: React.ReactNode;\n  /**\n   * The callback for when the button is clicked.\n   */\n  onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n}\n\n/**\n * A button to disconnect from the current agent session.\n * Calls the session's end() method when clicked.\n *\n * @extends ComponentProps<'button'>\n *\n * @example\n * ```tsx\n * <AgentDisconnectButton onClick={() => console.log('Disconnecting...')} />\n * ```\n */\nexport function AgentDisconnectButton({\n  icon,\n  size = 'default',\n  variant = 'destructive',\n  children,\n  onClick,\n  ...props\n}: AgentDisconnectButtonProps) {\n  const { end } = useSessionContext();\n  const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n    onClick?.(event);\n    if (typeof end === 'function') {\n      end();\n    }\n  };\n\n  return (\n    <Button size={size} variant={variant} onClick={handleClick} {...props}>\n      {icon ?? <PhoneOffIcon />}\n      {children ?? <span className={cn(size?.includes('icon') && 'sr-only')}>END CALL</span>}\n    </Button>\n  );\n}\n","type":"registry:component"}],"type":"registry:component"}