POLPOUI

ChatSessionsByAgent

Sessions grouped by agent with count badges and role descriptions.

Groups sessions by agent name and renders each group as a clickable row with the agent display name, role description, and a session count badge. Useful for multi-agent apps where users pick an agent first.

Preview

Import

import {
  ChatSessionsByAgent,
  type ChatSessionsByAgentProps,
  type AgentSessionGroup,
} from "@polpo-ai/chat";

Props

PropTypeDefaultDescription
sessionsChatSession[]requiredSession list from useSessions().sessions
agentsAgentConfig[]Agents list for resolving display names and roles
onSelect(agentName: string) => voidrequiredCalled when an agent group is selected
isLoadingbooleanShow skeleton loading state
emptyMessagestring"No conversations yet"Empty state message
classNamestringAdditional className on the outer container
renderAvatar(agent: AgentConfig | undefined, agentName: string) => ReactNodeCustom avatar renderer

Usage

<ChatSessionsByAgent
  sessions={sessions}
  agents={agents}
  onSelect={(agentName) => router.push(`/chat/${agentName}`)}
/>

On this page