mirror of
https://github.com/supabase/supabase.git
synced 2026-10-09 03:15:06 +03:00
* layout header icon styles * Update packages/ui/src/layout/ai-icon-animation/ai-icon-animation.tsx Co-authored-by: Alaister Young <alaister@users.noreply.github.com> --------- Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import { SqlEditor } from 'icons'
|
|
import { useAiAssistantStateSnapshot } from 'state/ai-assistant-state'
|
|
import { useAppStateSnapshot } from 'state/app-state'
|
|
import { ButtonTooltip } from 'components/ui/ButtonTooltip'
|
|
import { KeyboardShortcut } from 'ui'
|
|
|
|
export const InlineEditorButton = () => {
|
|
const { closeAssistant } = useAiAssistantStateSnapshot()
|
|
const { setEditorPanel, editorPanel } = useAppStateSnapshot()
|
|
|
|
return (
|
|
<ButtonTooltip
|
|
type="text"
|
|
size="tiny"
|
|
id="editor-trigger"
|
|
className="rounded-none w-[32px] h-[30px] flex items-center justify-center p-0 text-foreground-light hover:text-foreground"
|
|
onClick={() => {
|
|
closeAssistant()
|
|
setEditorPanel({ open: !editorPanel.open })
|
|
}}
|
|
tooltip={{
|
|
content: {
|
|
text: (
|
|
<div className="flex items-center gap-4">
|
|
<span>SQL Editor</span>
|
|
<KeyboardShortcut keys={['Meta', 'e']} />
|
|
</div>
|
|
),
|
|
},
|
|
}}
|
|
>
|
|
<SqlEditor size={18} strokeWidth={1.5} />
|
|
</ButtonTooltip>
|
|
)
|
|
}
|