Add thinking placeholder message (#496)
This commit is contained in:
parent
0001c24d09
commit
b5c165714b
4 changed files with 67 additions and 13 deletions
|
|
@ -8,7 +8,7 @@ import useSWR, { useSWRConfig } from 'swr';
|
|||
import { useWindowSize } from 'usehooks-ts';
|
||||
|
||||
import { ChatHeader } from '@/components/custom/chat-header';
|
||||
import { PreviewMessage } from '@/components/custom/message';
|
||||
import { PreviewMessage, ThinkingMessage } from '@/components/custom/message';
|
||||
import { useScrollToBottom } from '@/components/custom/use-scroll-to-bottom';
|
||||
import { Vote } from '@/db/schema';
|
||||
import { fetcher } from '@/lib/utils';
|
||||
|
|
@ -100,6 +100,12 @@ export function Chat({
|
|||
/>
|
||||
))}
|
||||
|
||||
{isLoading &&
|
||||
messages.length > 0 &&
|
||||
messages[messages.length - 1].role === 'user' && (
|
||||
<ThinkingMessage />
|
||||
)}
|
||||
|
||||
<div
|
||||
ref={messagesEndRef}
|
||||
className="shrink-0 min-w-[24px] min-h-[24px]"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue