import React from 'react'; import { X, Wrench, Bot, Copy, Check, Globe, Users } from 'lucide-react'; import { computeBadges, deriveSourceServer } from './toolBadges'; import { ToolStatusBadge } from './ToolStatusBadge'; export function ToolDetailDrawer({ item, onClose }) { const { kind, data } = item; const isA2A = kind === 'a2a_agent'; const a2aData = isA2A ? data : null; const toolUrl = kind === 'tool' ? data.url : undefined; const sourceServer = deriveSourceServer(toolUrl); const badges = computeBadges(data.name, data.description || '', isA2A ? 'A2A' : undefined, toolUrl); const [copied, setCopied] = React.useState(false); const copyId = () => { navigator.clipboard.writeText(data.id).catch(() => { }); setCopied(true); setTimeout(() => setCopied(false), 1500); }; const Icon = isA2A ? Bot : Wrench; const iconColor = isA2A ? 'text-violet-400' : 'text-cyan-400'; const gradientFrom = isA2A ? 'from-violet-500/20' : 'from-cyan-500/20'; const gradientTo = isA2A ? 'to-purple-500/20' : 'to-blue-500/20'; return (
{/* Backdrop */}
{/* Panel */}
e.stopPropagation()}> {/* Header */}

{data.name}

{sourceServer && (<> ยท {sourceServer} )}
{/* Body */}
{/* Type + Badges */}
{isA2A ? 'A2A Agent' : 'Tool'} {badges.map((b) => ( {b.label} ))}
{/* Description */}

Description

{data.description || 'No description available.'}

{/* A2A-specific: How to use */} {isA2A && (

How to Use

This A2A agent can be selected as a connected agent in your personas or agent projects. When enabled, your agents can delegate tasks to it.

)} {/* A2A-specific: Endpoint */} {isA2A && a2aData?.endpoint_url && (

Endpoint

{a2aData.endpoint_url}
)} {/* Collapsible ID */}
); }