Files
supabase/apps/studio/components/layouts/AppLayout/InlineEditorButton.tsx
T
Saxon FletcherandJoshen Lim a224598f1e Decouple editor panel (#37707)
* decouple editor panel from global state

* refactor again

* dont close assistant

* remove async

* onsave props

* Fix TS errors

* Remove editorPanel state from app-state, use useHotKey hooks for keyboard shortcuts

* Minor UX improvements to EditorPanel

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-08-06 15:03:53 +07:00

28 lines
792 B
TypeScript

import { ButtonTooltip } from 'components/ui/ButtonTooltip'
import { SqlEditor } from 'icons'
import { KeyboardShortcut } from 'ui'
export const InlineEditorButton = ({ onClick }: { onClick: () => void }) => {
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={onClick}
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>
)
}