Files
supabase/apps/studio/components/layouts/AppLayout/AssistantButton.tsx
T
Joshen LimandAlaister Young 8239e2f27b Cache results in assistant panel (#34509)
* Cache results in assistant panel

* Small fixes

* fix

* disable switching chats while new messages are streaming in

* small comment

* Fix Create new snippet CTA in query block

* Add useCallbacks

* Update

* Remove console log

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
2025-03-31 19:24:21 +08:00

26 lines
647 B
TypeScript

import { useAiAssistantStateSnapshot } from 'state/ai-assistant-state'
import { useAppStateSnapshot } from 'state/app-state'
import { AiIconAnimation, Button } from 'ui'
const AssistantButton = () => {
const snap = useAiAssistantStateSnapshot()
const { setEditorPanel } = useAppStateSnapshot()
return (
<Button
type="text"
size="tiny"
id="assistant-trigger"
className="h-full w-full rounded-none"
onClick={() => {
snap.toggleAssistant()
setEditorPanel({ open: false })
}}
>
<AiIconAnimation allowHoverEffect size={20} />
</Button>
)
}
export default AssistantButton