{messages.map((message, index) => {
return (
// The latest message sent by the user will be animated while waiting for a response
{/* Display the correct icon depending on the message type */}
{message.type === 'apiMessage' ? (
) : (
)}
{/* Messages are being rendered in Markdown format */}
{message.message}
)
})}