| // src/components/agents/AgentDetailModal.tsx | |
| import { motion, AnimatePresence } from "framer-motion"; | |
| import { X, Bot, Cpu, Zap, Clock, Database, CheckCircle2 } from "lucide-react"; | |
| import { AgentDefinition } from "@/types/multi-agent"; | |
| interface AgentDetailModalProps { | |
| agent: AgentDefinition | null; | |
| isOpen: boolean; | |
| onClose: () => void; | |
| } | |
| export function AgentDetailModal({ agent, isOpen, onClose }: AgentDetailModalProps) { | |
| if (!agent) return null; | |
| return ( | |
| <AnimatePresence> | |
| {isOpen && ( | |
| <> | |
| <div className="fixed inset-0 bg-black/50 z-50" onClick={onClose} /> | |
| <motion.div | |
| initial={{ opacity: 0, scale: 0.95, y: 20 }} | |
| animate={{ opacity: 1, scale: 1, y: 0 }} | |
| exit={{ opacity: 0, scale: 0.95, y: 20 }} | |
| className="fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-full max-w-lg bg-white dark:bg-gray-800 rounded-2xl shadow-2xl z-50 overflow-hidden" | |
| > | |
| <div className="flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700"> | |
| <div className="flex items-center gap-3"> | |
| <span className="text-3xl">{agent.icon || "🤖"}</span> | |
| <div> | |
| <h2 className="text-xl font-bold">{agent.name}</h2> | |
| <p className="text-sm text-gray-500">{agent.role.replace(/_/g, " ")}</p> | |
| </div> | |
| </div> | |
| <button onClick={onClose} className="p-1 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700"> | |
| <X className="w-5 h-5" /> | |
| </button> | |
| </div> | |
| <div className="p-4 space-y-4"> | |
| <p className="text-gray-600 dark:text-gray-300">{agent.description}</p> | |
| <div> | |
| <h3 className="text-sm font-semibold flex items-center gap-2 mb-2"> | |
| <Cpu className="w-4 h-4" /> Capabilities | |
| </h3> | |
| <div className="flex flex-wrap gap-2"> | |
| {agent.capabilities.map(cap => ( | |
| <span key={cap} className="px-2 py-1 text-xs bg-primary/10 text-primary rounded-full"> | |
| {cap} | |
| </span> | |
| ))} | |
| </div> | |
| </div> | |
| <div className="grid grid-cols-2 gap-3 text-sm"> | |
| <div className="flex items-center gap-2"> | |
| <Zap className="w-4 h-4 text-yellow-500" /> | |
| <span>Model: {agent.model}</span> | |
| </div> | |
| <div className="flex items-center gap-2"> | |
| <Clock className="w-4 h-4" /> | |
| <span>Temp: {agent.temperature}</span> | |
| </div> | |
| <div className="flex items-center gap-2"> | |
| <Database className="w-4 h-4" /> | |
| <span>Max Tokens: {agent.maxTokens}</span> | |
| </div> | |
| <div className="flex items-center gap-2"> | |
| <CheckCircle2 className="w-4 h-4 text-green-500" /> | |
| <span>{agent.isActive ? "Active" : "Inactive"}</span> | |
| </div> | |
| </div> | |
| <div> | |
| <h3 className="text-sm font-semibold flex items-center gap-2 mb-2">Tools</h3> | |
| <div className="flex flex-wrap gap-2"> | |
| {agent.tools.map(tool => ( | |
| <span key={tool} className="px-2 py-1 text-xs bg-gray-100 dark:bg-gray-700 rounded-full"> | |
| {tool} | |
| </span> | |
| ))} | |
| </div> | |
| </div> | |
| <div className="bg-gray-50 dark:bg-gray-700/30 rounded-lg p-3"> | |
| <p className="text-xs font-semibold text-gray-500 mb-1">System Prompt</p> | |
| <p className="text-xs text-gray-600 dark:text-gray-400">{agent.systemPrompt}</p> | |
| </div> | |
| </div> | |
| </motion.div> | |
| </> | |
| )} | |
| </AnimatePresence> | |
| ); | |
| } |
Xet Storage Details
- Size:
- 4 kB
- Xet hash:
- 30e239c90aaf80d92d310a30ee44ab9ea61a05bac1afb5b5119a04e17d91d501
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.