MCPcopy Create free account
hub / github.com/ScrapeGraphAI/scrapecraft / MessageList

Function MessageList

frontend/src/components/Chat/MessageList.tsx:6–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4import LoadingSpinner from '../Common/LoadingSpinner';
5
6const MessageList: React.FC = () => {
7 const { messages, isLoading } = useChatStore();
8 const messagesEndRef = useRef<HTMLDivElement>(null);
9
10 const scrollToBottom = () => {
11 messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' });
12 };
13
14 useEffect(() => {
15 scrollToBottom();
16 }, [messages]);
17
18 return (
19 <div className="flex-1 overflow-y-auto p-4">
20 {messages.map((message) => (
21 <MessageBubble key={message.id} message={message} />
22 ))}
23
24 {isLoading && (
25 <div className="flex items-center space-x-2 text-muted">
26 <LoadingSpinner />
27 <span className="text-sm">AI is thinking...</span>
28 </div>
29 )}
30
31 <div ref={messagesEndRef} />
32 </div>
33 );
34};
35
36export default MessageList;

Callers

nothing calls this directly

Calls 1

scrollToBottomFunction · 0.85

Tested by

no test coverage detected