import { useState } from 'react'; import { AnimatePresence } from 'framer-motion'; import { Settings2 } from 'lucide-react'; import { ControlFleetHost, ControlPerfSample, ControlConnection } from '@/hooks/useControlStream'; import { HostCard } from './HostCard'; import { HostConfigEditor } from './HostConfigEditor'; export interface GpuData { vram_used: number; vram_total: number; temperature: number; power: number; } interface FleetTabProps { hosts: ControlFleetHost[]; gpuMap: Map; perfSamples?: ControlPerfSample[]; connection?: ControlConnection; } export function FleetTab({ hosts, gpuMap, perfSamples = [], connection = 'connecting' }: FleetTabProps) { const [editing, setEditing] = useState(null); if (hosts.length === 0) { // B3: distinguish "not connected" from a genuinely empty fleet. const msg = connection === 'live' ? 'No hosts connected' : connection === 'down' ? 'Control service unreachable — retrying…' : 'Connecting to control service…'; return (

{msg}

); } return (
{hosts.map((host) => (
))}
{editing && setEditing(null)} />}
); }