import clsx from 'clsx'; import { RefObject } from 'react'; import type { ChatBubble } from './types'; interface ChatMessagesProps { messages: ReadonlyArray; isWaitingForResponse: boolean; scrollContainerRef: RefObject; onScroll: () => void; } export function ChatMessages({ messages, isWaitingForResponse, scrollContainerRef, onScroll }: ChatMessagesProps) { return (
{messages.length === 0 && } {messages.map((message, index) => { const isUser = message.role === 'user'; const isDraft = message.role === 'draft'; const next = messages[index + 1]; const tail = !next || next.role !== message.role; return (
{message.text}
); })} {isWaitingForResponse && }
); } function TypingIndicator() { return (
); } function EmptyState() { return (

Start a conversation

Your messages will appear here. Send something to get started.

); }