POLPOUI

ChatSessionList

Flat list of chat sessions with selection, delete, and agent avatar support.

Renders a scrollable list of chat sessions with active state highlighting, relative timestamps, agent display names, and optional delete buttons.

Preview

C
Add users table to Prisma schema
Coder·30m ago
C
Debug authentication middleware
Coder·An hour ago
W
Write API documentation
Writer·12h ago
R
Review pull request #42
Reviewer·Apr 6, 06:00 PM

Import

import { ChatSessionList, type ChatSessionListProps } from "@polpo-ai/chat";

Props

PropTypeDefaultDescription
sessionsChatSession[]requiredSession list from useSessions().sessions
agentsAgentConfig[]Agents list for resolving display names
activeSessionIdstring | nullCurrently active session ID (highlighted)
onSelect(sessionId: string) => voidrequiredCalled when a session is selected
onDelete(sessionId: string) => voidCalled when delete is requested; omit to hide delete buttons
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

const { sessions } = useSessions();
const { agents } = useAgents();

<ChatSessionList
  sessions={sessions}
  agents={agents}
  activeSessionId={currentId}
  onSelect={(id) => setCurrentId(id)}
  onDelete={(id) => deleteSession(id)}
/>

On this page