import { useState } from 'react'; const colorMap = { blue: { bg: 'bg-blue-500/10', border: 'border-blue-500/30', text: 'text-blue-400', glow: 'shadow-blue-500/20' }, purple: { bg: 'bg-purple-500/10', border: 'border-purple-500/30', text: 'text-purple-400', glow: 'shadow-purple-500/20' }, indigo: { bg: 'bg-indigo-500/10', border: 'border-indigo-500/30', text: 'text-indigo-400', glow: 'shadow-indigo-500/20' }, green: { bg: 'bg-green-500/10', border: 'border-green-500/30', text: 'text-green-400', glow: 'shadow-green-500/20' }, pink: { bg: 'bg-pink-500/10', border: 'border-pink-500/30', text: 'text-pink-400', glow: 'shadow-pink-500/20' }, orange: { bg: 'bg-orange-500/10', border: 'border-orange-500/30', text: 'text-orange-400', glow: 'shadow-orange-500/20' }, yellow: { bg: 'bg-yellow-500/10', border: 'border-yellow-500/30', text: 'text-yellow-400', glow: 'shadow-yellow-500/20' }, cyan: { bg: 'bg-cyan-500/10', border: 'border-cyan-500/30', text: 'text-cyan-400', glow: 'shadow-cyan-500/20' }, red: { bg: 'bg-red-500/10', border: 'border-red-500/30', text: 'text-red-400', glow: 'shadow-red-500/20' }, teal: { bg: 'bg-teal-500/10', border: 'border-teal-500/30', text: 'text-teal-400', glow: 'shadow-teal-500/20' }, violet: { bg: 'bg-violet-500/10', border: 'border-violet-500/30', text: 'text-violet-400', glow: 'shadow-violet-500/20' }, }; const statusConfig = { idle: { label: 'Idle', dot: 'bg-gray-600', bg: 'bg-gray-500/5' }, active: { label: 'Active', dot: 'bg-yellow-500 animate-pulse', bg: '' }, done: { label: 'Done', dot: 'bg-green-500', bg: '' }, failed: { label: 'Failed', dot: 'bg-red-500', bg: '' }, }; export default function AgentGrid({ agents, statuses, currentPhase }) { const [selectedAgent, setSelectedAgent] = useState(null); const phaseNames = ['Planning', 'Execution', 'Validation', 'Documentation', 'Learning']; return (
{/* Phase Indicator */} {currentPhase >= 0 && (
Current Phase: {phaseNames[currentPhase] || 'Unknown'}
{phaseNames.map((name, i) => (
))}
)} {/* Agent Grid */}
{agents.map((agent, index) => { const colors = colorMap[agent.color]; const status = statuses[agent.id] || 'idle'; const statusInfo = statusConfig[status]; const isSelected = selectedAgent === agent.id; return (
setSelectedAgent(isSelected ? null : agent.id)} className={`agent-card cursor-pointer animate-slide-up ${ status === 'active' ? `${colors.bg} ${colors.border} shadow-lg ${colors.glow}` : status === 'done' ? 'border-green-500/20' : '' }`} style={{ animationDelay: `${index * 50}ms` }} >
{agent.icon}

{agent.name}

{statusInfo.label}

{agent.description}

{isSelected && (
Agent ID: {agent.id}
Status: {status.toUpperCase()}
Phase: {currentPhase >= 0 ? phaseNames[currentPhase] : 'Waiting'}
)}
); })}
); }