mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 16:06:01 +00:00
sql editor context menu
This commit is contained in:
29
packages/web/src/sqleditor/SqlEditorContextMenu.js
Normal file
29
packages/web/src/sqleditor/SqlEditorContextMenu.js
Normal file
@@ -0,0 +1,29 @@
|
||||
import React from 'react';
|
||||
import { DropDownMenuItem, DropDownMenuDivider } from '../modals/DropDownMenu';
|
||||
|
||||
export default function SqlEditorContextMenu({ execute, insertJoin, toggleComment, formatCode }) {
|
||||
return (
|
||||
<>
|
||||
{!!execute && (
|
||||
<DropDownMenuItem onClick={execute} keyText="F5 or Ctrl+Enter">
|
||||
Execute query
|
||||
</DropDownMenuItem>
|
||||
)}
|
||||
{!!insertJoin && (
|
||||
<DropDownMenuItem onClick={insertJoin} keyText="Ctrl+J">
|
||||
Insert SQL Join
|
||||
</DropDownMenuItem>
|
||||
)}
|
||||
{!!toggleComment && (
|
||||
<DropDownMenuItem onClick={toggleComment} keyText="Ctrl+/">
|
||||
Toggle comment
|
||||
</DropDownMenuItem>
|
||||
)}
|
||||
{!!formatCode && (
|
||||
<DropDownMenuItem onClick={formatCode} >
|
||||
Format code
|
||||
</DropDownMenuItem>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user