"use client"; import type { UIMessage } from "ai"; import { Message } from "./Message"; type ThreadProps = { messages: UIMessage[]; isLoading: boolean; children?: React.ReactNode; }; function ThreadWelcome() { return (

How can I help you today?

Send a message to start a conversation.

); } function LoadingIndicator() { return (
); } export function Thread({ messages, isLoading, children }: ThreadProps) { return (
{messages.length === 0 ? ( ) : (
{messages.map((msg) => ( ))} {isLoading && }
)}
{children}
); }