import React from "react"; import { ChatMessage } from "#/components/features/chat/chat-message"; import { ConfirmationButtons } from "#/components/shared/buttons/confirmation-buttons"; import { ImageCarousel } from "../images/image-carousel"; import { ExpandableMessage } from "./expandable-message"; interface MessagesProps { messages: Message[]; isAwaitingUserConfirmation: boolean; } export const Messages: React.FC = React.memo( ({ messages, isAwaitingUserConfirmation }) => messages.map((message, index) => { if (message.type === "error" || message.type === "action") { return ( ); } return ( {message.imageUrls && message.imageUrls.length > 0 && ( )} {messages.length - 1 === index && message.sender === "assistant" && isAwaitingUserConfirmation && } ); }), ); Messages.displayName = "Messages";