import type { RefObject } from 'react'; import { ArrowDown } from 'lucide-react'; import type { ChatMessage } from './types'; import { MessageBubble, StreamingBubble } from './MessageBubble'; type MessageListProps = { messages: ChatMessage[]; streamingText: string; isGenerating: boolean; showJumpToBottom: boolean; onJumpToBottom: () => void; onQuestionAnswer?: (text: string) => void; scrollViewportRef: RefObject; bottomRef: RefObject; }; export const MessageList = ({ messages, streamingText, isGenerating, showJumpToBottom, onJumpToBottom, onQuestionAnswer, scrollViewportRef, bottomRef, }: MessageListProps) => (
{messages.length === 0 && !isGenerating && (
Send a message to start
)} {messages.map((msg, i) => ( ))} {isGenerating && }
{showJumpToBottom && ( )}
);