Spaces:
Sleeping
Sleeping
Download web/src/components/chat/MessageList.jsx from Danishathugging/Agently: direct link, hf CLI and curl.
- Browser
- Download file 768 Bytes
-
https://huggingface.co/spaces/Danishathugging/Agently/resolve/main/web/src/components/chat/MessageList.jsx
- Command line
-
hf download hf://spaces/Danishathugging/Agently/web/src/components/chat/MessageList.jsx
-
curl -L -o MessageList.jsx https://huggingface.co/spaces/Danishathugging/Agently/resolve/main/web/src/components/chat/MessageList.jsx
768 Bytes
| import { useEffect, useRef } from 'react' | |
| import MessageBubble from './MessageBubble.jsx' | |
| import ThinkingIndicator from './ThinkingIndicator.jsx' | |
| export default function MessageList({ messages, isThinking, statusText, onImageClick }) { | |
| const bottomRef = useRef(null) | |
| useEffect(() => { | |
| bottomRef.current?.scrollIntoView({ behavior: 'smooth', block: 'end' }) | |
| }, [messages, isThinking, statusText]) | |
| return ( | |
| <section className="message-list"> | |
| {messages.map((message) => ( | |
| <MessageBubble | |
| key={message.id} | |
| message={message} | |
| onImageClick={onImageClick} | |
| /> | |
| ))} | |
| {isThinking && ( | |
| <ThinkingIndicator statusText={statusText} /> | |
| )} | |
| <div ref={bottomRef} /> | |
| </section> | |
| ) | |
| } | |