mirror of
https://github.com/supabase/supabase.git
synced 2026-10-13 21:29:08 +03:00
* 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>
26 lines
647 B
TypeScript
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
|