// — the agent's icon from swarm-controller's // `GET /api/agents/{name}/icon`: an agent with no icon (404) or an unreachable // controller shows the default agent icon, dimmed, instead of a broken image. // It is a robot head in a round frame, so it is not mistaken for a swarm // service, whose icons sit in a hexagon. // Always an ``: the body is an agent-authored SVG, and only an image load // keeps its script from running. import { useState } from "preact/hooks"; import "./AgentIcon.css"; export function AgentIcon({ name, small = false, }: { name: string; /** Badge-sized, for beside a line of text, rather than the card's square. */ small?: boolean; }) { const [fallback, setFallback] = useState(false); return (
setFallback(true)} />
); }