import type { ReactNode, SVGProps } from 'react'; import { Bot } from 'lucide-react'; import { Badge } from '../components/ui/badge'; type AgentIconComponent = (props: SVGProps) => ReactNode; const CodexIcon: AgentIconComponent = (props) => ( ); const ClaudeIcon: AgentIconComponent = (props) => ( ); const CursorIcon: AgentIconComponent = (props) => ( ); const GeminiIcon: AgentIconComponent = (props) => ( ); const CopilotIcon: AgentIconComponent = (props) => ( ); const WarpIcon: AgentIconComponent = (props) => ( ); const ClineIcon: AgentIconComponent = (props) => ( ); const AntigravityIcon: AgentIconComponent = (props) => ( ); const AmpIcon: AgentIconComponent = (props) => ( ); const getAgentIcon = (agent: string): AgentIconComponent | null => { const normalized = agent.toLowerCase(); const hasToken = (token: string) => new RegExp(`(^|[^a-z0-9])${token}([^a-z0-9]|$)`).test(normalized); if (normalized.includes('codex') || normalized.includes('openai')) { return CodexIcon; } if (normalized.includes('claude')) { return ClaudeIcon; } if (normalized.includes('cursor')) { return CursorIcon; } if (normalized.includes('gemini')) { return GeminiIcon; } if (normalized.includes('copilot')) { return CopilotIcon; } if (normalized.includes('warp')) { return WarpIcon; } if (normalized.includes('cline')) { return ClineIcon; } if (normalized.includes('antigravity')) { return AntigravityIcon; } if (hasToken('amp')) { return AmpIcon; } return null; }; export function AgentBadge({ agent }: { agent: string }) { const Icon = getAgentIcon(agent) ?? Bot; return ( {agent} ); }