import type { Conversation } from '../types'; /** Initials for the avatar chip — first letters of the first two words. */ function initials(title: string): string { const parts = title.trim().split(/\s+/).filter(Boolean); const chars = (parts[0]?.[0] ?? '') + (parts[1]?.[0] ?? ''); return (chars || '?').toUpperCase(); } /** * Presentational conversation list. Owns no data fetching — the parent passes the * conversations (from useConversations) so a host can also drive it from its own store. */ export function ConversationList({ conversations, selectedId, onSelect, }: { conversations: Conversation[]; selectedId?: string | null; onSelect: (threadId: string) => void; }) { if (conversations.length === 0) { return
No conversations yet.
; } return ( ); }