/** * Legend — color-to-name roster legend (unused, kept for reference). * * Maps each agent's dot color to their name and lets the user focus the * camera by clicking a name. * * Architecture: not currently rendered — SimCanvas draws labels directly; * retained as the planned clickable roster. * * Design: superseded by on-canvas labels; left in the tree until the * focus UX is finalized. */ export default function Legend({ agents, focusedId, onFocus }) { if (!agents) return null; const entries = Object.entries(agents); if (!entries.length) return null; return (
Students
{entries.map(([id, a]) => { const focused = id === focusedId; return (
onFocus && onFocus(focused ? null : id)} style={{ display: "flex", alignItems: "center", gap: 8, padding: "3px 4px", borderRadius: 4, cursor: "pointer", background: focused ? "rgba(212,160,74,0.14)" : "transparent", transition: "background 0.15s", }} > {a.name} {a.in_conversation && ( chatting )}
); })}
); }