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