Files
supabase/apps/studio/components/layouts/AppLayout/InlineEditorButton.tsx
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

27 lines
717 B
TypeScript

import { SqlEditor } from 'icons'
import { useAiAssistantStateSnapshot } from 'state/ai-assistant-state'
import { useAppStateSnapshot } from 'state/app-state'
import { Button } from 'ui'
const InlineEditorButton = () => {
const { closeAssistant } = useAiAssistantStateSnapshot()
const { setEditorPanel, editorPanel } = useAppStateSnapshot()
return (
<Button
type="text"
size="tiny"
id="editor-trigger"
className="h-full w-full rounded-none text-foreground-light"
onClick={() => {
closeAssistant()
setEditorPanel({ open: !editorPanel.open })
}}
>
<SqlEditor size={20} strokeWidth={1.5} />
</Button>
)
}
export default InlineEditorButton