"use client"; import { useEffect, useRef } from "react"; import type { AssistantMessageInterface } from "../../../assistant-message/data/AssistantMessageInterface"; import { MessageList } from "../../../assistant-message/components/MessageList"; import type { ApprovalActionRenderer, MentionRenderer } from "../../../assistant-message/components/MessageItem"; import { AssistantStatusLine } from "./AssistantStatusLine"; interface Props { messages: AssistantMessageInterface[]; sending: boolean; status?: string; onSelectFollowUp: (q: string) => void; failedMessageIds?: Set; onRetry?: (tempId: string) => void; renderApprovalAction?: ApprovalActionRenderer; renderMention?: MentionRenderer; } export function AssistantThread({ messages, sending, status, onSelectFollowUp, failedMessageIds, onRetry, renderApprovalAction, renderMention, }: Props) { const endRef = useRef(null); useEffect(() => { endRef.current?.scrollIntoView({ behavior: "smooth" }); }, [messages.length, sending]); return (
{sending && }
); }