Skip to content

An AI-powered search engine with a generative UI

chore: Update chat panel clear button functionality

Yoshiki Miuraee0908e0be03
diff --git a/components/chat-panel.tsx b/components/chat-panel.tsx
index 2c24735c..ba6f81ea 100644
--- a/components/chat-panel.tsx
+++ b/components/chat-panel.tsx
@@ -76,6 +76,8 @@ export function ChatPanel({ messages, query }: ChatPanelProps) {
// Clear messages
const handleClear = () => {
setIsGenerating(false)
+ setMessages([])
+ setInput('')
router.push('/')
}
@@ -93,6 +95,7 @@ export function ChatPanel({ messages, query }: ChatPanelProps) {
variant={'secondary'}
className="rounded-full bg-secondary/80 group transition-all hover:scale-105 pointer-events-auto"
onClick={() => handleClear()}
+ disabled={isGenerating}
>
<span className="text-sm mr-2 group-hover:block hidden animate-in fade-in duration-300">
New