"use client"; import React from "react"; interface AgentSelectorProps { selectedAgent?: string | null; onChange?: (agent: string | null) => void; disabled?: boolean; } const AGENT_CONFIG = { jarvis: { displayName: "Jarvis", role: "Orchestrator", color: "#3498db", }, builder: { displayName: "Builder", role: "Coding Agent", color: "#3b82f6", }, medic: { displayName: "Medic", role: "Health Monitor", color: "#10b981", }, } as const; function JarvisIcon({ className }: { className?: string }): React.ReactElement { return ( ); } function BuilderIcon({ className }: { className?: string }): React.ReactElement { return ( ); } function MedicIcon({ className }: { className?: string }): React.ReactElement { return ( ); } const AGENT_ICONS: Record> = { jarvis: JarvisIcon, builder: BuilderIcon, medic: MedicIcon, }; export function AgentSelector({ selectedAgent, onChange, disabled, }: AgentSelectorProps): React.ReactElement { return ( Agent {Object.entries(AGENT_CONFIG).map(([name, config]) => { const Icon = AGENT_ICONS[name]; const isSelected = selectedAgent === name; return ( onChange?.(isSelected ? null : name)} disabled={disabled} className={`flex items-center gap-1.5 px-2 py-1.5 rounded-lg border transition-all text-xs ${ isSelected ? "border-primary bg-primary/10 shadow-sm" : "hover:bg-muted/50" } ${disabled ? "opacity-50 cursor-not-allowed" : ""}`} style={{ borderColor: isSelected ? "rgb(var(--accent-primary))" : "rgb(var(--border-default))", color: isSelected ? "rgb(var(--accent-primary))" : "rgb(var(--text-primary))", }} title={`${config.displayName} — ${config.role}`} > {Icon && } {config.displayName} ); })} ); }