'use client'; import { ChatList } from '@/components/chat/ChatList'; import { Composer } from '@/components/chat/Composer'; import { ChatEntity } from '@/lib/types'; import useVisionAgent from '@/lib/hooks/useVisionAgent'; import { useScrollAnchor } from '@/lib/hooks/useScrollAnchor'; import { Session } from 'next-auth'; import { useState } from 'react'; export interface ChatProps extends React.ComponentProps<'div'> { chat: ChatEntity; isAdminView?: boolean; session: Session | null; } export function Chat({ chat, session, isAdminView }: ChatProps) { const { url, id } = chat; const [enableSelfReflection, setEnableSelfReflection] = useState(true); const { messages, append, reload, stop, isLoading, input, setInput } = useVisionAgent(chat, enableSelfReflection); const { messagesRef, scrollRef, visibilityRef, isAtBottom, scrollToBottom } = useScrollAnchor(); return ( <>
{!isAdminView && (
)} ); }