import Stack from "@moduletrace/twui/layout/Stack"; import type { BotMessageWithAttachments, BotWithLastMessage, } from "@/src/types"; import groupMessages from "../(utils)/group-messages"; import BotThinkingRow from "./bot-thinking-row"; import MessageGroupBlock from "./message-group-block"; type Props = { bot: BotWithLastMessage; messages: BotMessageWithAttachments[]; /** * The latest step of the bot's active task, shown while it works. */ progress?: string | null; /** * This session has an active task. */ has_task?: boolean; }; /** * Bottom-anchored: the stack sits 24px above the composer rule and grows * upward. Empty space belongs at the top. New messages announce politely. * While the bot works on a reply or a task, a status row sits under the * last one. */ export default function MessageThread({ bot, messages, progress, has_task }: Props) { const groups = groupMessages({ messages }); return ( {groups.map((group) => ( ))} ); }