import { type UseChatHelpers } from 'ai/react' import { Button } from '@/components/ui/button' import { PromptForm } from '@/components/prompt-form' import { ButtonScrollToBottom } from '@/components/button-scroll-to-bottom' import { IconRefresh, IconStop } from '@/components/ui/icons' import { FooterText } from '@/components/footer' export interface ChatPanelProps extends Pick< UseChatHelpers, | 'append' | 'isLoading' | 'reload' | 'messages' | 'stop' | 'input' | 'setInput' > { id?: string } export function ChatPanel({ id, isLoading, stop, append, reload, input, setInput, messages }: ChatPanelProps) { return (
{isLoading ? ( ) : ( messages?.length > 0 && ( ) )}
{ await append({ id, content: value, role: 'user' }) }} input={input} setInput={setInput} isLoading={isLoading} />
) }