mirror of
https://github.com/supabase/supabase.git
synced 2026-10-09 03:15:06 +03:00
* 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>
28 lines
792 B
TypeScript
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>
|
|
)
|
|
}
|