{/* Message display area */}
{/* Use ChatMessages component */}
{conversation.map((msg, index) => (
{/* Message rendering */}
{typeof msg.content === 'string' ? msg.content : msg.content}
{/* Related Topics (shown only after the latest assistant message) */}
{msg.role === 'assistant' &&
index === conversation.length - 1 &&
relatedTopics.length > 0 && (
Related Topics:
{relatedTopics.map((topic, i) => (
))}
)}
))}
{/* Div to scroll to */}
{/* Thinking Indicator (conditionally rendered) */}
{isThinking &&
}
{/* Combined Input and Controls Area */}
{/* Text Input Form */}
{/* Voice Controls */}
{/* Mic Button */}
{/* End Input and Controls Area */}
{/* End Main chat area */}