import React, { useRef, useEffect } from 'react'; import { ChatMessage } from '../../types/workbench'; import { MessageBubble } from './MessageBubble'; export interface MessageStreamProps { messages: ChatMessage[]; onOpenCase?: (docId: string) => void; onCardAction?: (cardId: string, actionId: string, payload?: any) => void; onErrorAction?: (messageId: string, action: 'retry' | 'continue' | 'restart') => void; } export const MessageStream: React.FC = ({ messages, onOpenCase, onCardAction, onErrorAction, }) => { const bottomRef = useRef(null); useEffect(() => { bottomRef.current?.scrollIntoView({ behavior: 'smooth' }); }, [messages]); return (
{messages.length === 0 ? (
暂无对话记录,请在下方发送立项需求
) : ( messages.map((msg) => ( )) )}
); };