File size: 1,431 Bytes
f3a9ef2
 
 
052672d
 
f3a9ef2
a8e1cb0
c3e8f3d
 
 
f3a9ef2
 
f80b091
f3a9ef2
 
a8e1cb0
f80b091
 
f3a9ef2
f80b091
 
 
 
 
 
 
 
 
d0a1b70
f80b091
 
 
 
d0a1b70
f80b091
 
 
 
 
 
 
 
d0a1b70
f80b091
 
f3a9ef2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
'use client';
import { cn } from '@/lib/utils';
import { ChatList } from '@/components/chat/ChatList';
import { ChatPanel } from '@/components/chat/ChatPanel';
import { ChatScrollAnchor } from '@/components/chat/ChatScrollAnchor';
import ImageList from './ImageList';
import useChatWithDataset from '../../lib/hooks/useChatWithDataset';
import { useChat } from 'ai/react';
import { Button } from '../ui/Button';
import ImageSelector from './ImageSelector';

export interface ChatProps extends React.ComponentProps<'div'> {
  id: string;
}

export function Chat({ id, className }: ChatProps) {
  const { messages, append, reload, stop, isLoading, input, setInput } =
    useChat();

  return (
    <>
      <div className={cn('pb-[150px] pt-4 md:pt-10 h-full', className)}>
        <div className="flex h-full">
          <div className="w-1/2 relative border-r border-gray-400 overflow-auto">
            {/* <ImageList /> */}
            <ImageSelector />
          </div>
          <div className="w-1/2 relative overflow-auto">
            {/* <ChatList messages={messages} /> */}
            <ChatScrollAnchor trackVisibility={isLoading} />
          </div>
        </div>
      </div>
      {/* <ChatPanel
        id={id}
        isLoading={isLoading}
        stop={stop}
        append={append}
        reload={reload}
        messages={messages}
        input={input}
        setInput={setInput}
      /> */}
    </>
  );
}