'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'; import { ChatMessage } from './ChatMessage'; export interface ChatClientProps { chat: ChatWithMessages; } const ChatClient: React.FC = ({ chat }) => { const { mediaUrl, id } = chat; const { messages, append, reload, stop, isLoading, input, setInput } = useVisionAgent(chat); const { messagesRef, scrollRef, visibilityRef, isAtBottom, scrollToBottom } = useScrollAnchor(); return (
{messages // .filter(message => message.role !== 'system') .map((message, index) => ( ))}
); }; export default ChatClient;