mirror of
https://github.com/supabase/supabase.git
synced 2026-10-16 06:39:09 +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>
27 lines
717 B
TypeScript
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
|