import React from 'react'; import { Radio, Boxes } from 'lucide-react'; export function InstalledServerCard({ server, onClick }) { const isGateway = server.kind === 'gateway'; const Icon = isGateway ? Radio : Boxes; // Status logic: // - connected: has tools and is enabled (normal active server) // - offline: has tools but is disabled (was installed, now unreachable) // - not-installed: 0 tools (shouldn't normally appear — filtered out upstream) const hasTools = server.toolCount > 0; const isEnabled = server.enabled !== false; const status = hasTools && isEnabled ? 'connected' : hasTools && !isEnabled ? 'offline' : 'not-installed'; const statusColor = { connected: 'text-emerald-300', offline: 'text-amber-300', 'not-installed': 'text-white/30', }[status] ?? 'text-white/40'; const dotColor = { connected: 'bg-emerald-400', offline: 'bg-amber-400', 'not-installed': 'bg-white/20', }[status] ?? 'bg-white/30'; const statusLabel = { connected: `${server.toolCount} tool${server.toolCount !== 1 ? 's' : ''}`, offline: 'Offline', 'not-installed': 'Not installed', }[status] ?? 'Unknown'; return (
{server.description}
{/* Footer badges */}