{agentList.length > 0 ? (
groupedAgents.map(([groupName, list]) => (
-
- {groupName}
- {list.length}
-
+ {!collapsed && (
+
+ {groupName}
+ {list.length}
+
+ )}
{list.map((a) => {
const isActive = a.id === activeAgentId;
- return (
+ const content = (
onSelect(a.id)}
@@ -103,28 +123,41 @@ export default function AgentSidebar(props: {
(a.name?.charAt(0) || '?').toUpperCase()
)}
-
+ {!collapsed && (
+
+ )}
);
+
+ if (collapsed) {
+ return (
+
+ {content}
+
+ );
+ }
+ return content;
})}
))
) : !loadingTimeout ? (