import React, { useEffect, useRef } from 'react'; import Typography from '../ui/Typography'; import MessageBubble from './MessageBubble'; import { ScrollArea } from '../ui/scroll-area'; import { motion } from 'framer-motion'; import type { Message } from '../../stores/agentStore'; import type { UserProfile } from '../../types/userProfile'; import { FiMessageSquare } from 'react-icons/fi'; interface MessageListProps { messages: Message[]; isLoading?: boolean; userProfile?: UserProfile | null; isHCS10?: boolean; agentName?: string; onAgentProfileClick?: ( accountId: string, agentName: string, network: string ) => void; } /** * Display chat messages with proper styling and auto-scroll */ const MessageList: React.FC = ({ messages, isLoading = false, userProfile, isHCS10, agentName, onAgentProfileClick, }) => { const messagesEndRef = useRef(null); const scrollToBottom = () => { messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' }); }; useEffect(() => { scrollToBottom(); }, [messages]); const EmptyState = () => (
Welcome to HOL Desktop I can help you with Hedera Hashgraph operations, account management, token transfers, smart contracts, and more. Start by asking me a question or requesting help with a task.
Try asking me:
  • • "What's my account balance?"
  • • "Transfer 5 HBAR to 0.0.123456"
  • • "Help me create a new account"
  • • "Send a message to HCS topic"
); if (messages.length === 0) { return ; } return (
{messages.map((message) => ( ))} {isLoading && (
Assistant is thinking...
)}
); }; export default MessageList;