CommandMenu.tsx68 lines · main
| 1 | import { IS_PLATFORM } from 'common' |
| 2 | import { |
| 3 | CommandHeader, |
| 4 | CommandMenu, |
| 5 | CommandMenuInput, |
| 6 | CommandMenuList, |
| 7 | } from 'ui-patterns/CommandMenu' |
| 8 | import { useChangelogCommand } from 'ui-patterns/CommandMenu/prepackaged/Changelog' |
| 9 | import { useDocsAiCommands } from 'ui-patterns/CommandMenu/prepackaged/DocsAi' |
| 10 | import { useDocsSearchCommands } from 'ui-patterns/CommandMenu/prepackaged/DocsSearch' |
| 11 | import { useThemeSwitcherCommands } from 'ui-patterns/CommandMenu/prepackaged/ThemeSwitcher' |
| 12 | |
| 13 | import { useApiKeysCommands } from './ApiKeys' |
| 14 | import { useApiUrlCommand } from './ApiUrl' |
| 15 | import { useContextSearchCommands } from './ContextSearchCommands' |
| 16 | import { useCreateCommands } from './CreateCommands' |
| 17 | import { orderCommandSectionsByPriority } from './ordering' |
| 18 | import { useConfigureOrganizationCommand, useProjectSwitchCommand } from './OrgProjectSwitcher' |
| 19 | import { useSupportCommands } from './Support' |
| 20 | import { useBranchCommands } from '@/components/interfaces/BranchManagement/Branch.Commands' |
| 21 | import { useConnectCommands } from '@/components/interfaces/ConnectButton/Connect.Commands' |
| 22 | import { |
| 23 | useQueryTableCommands, |
| 24 | useSnippetCommands, |
| 25 | } from '@/components/layouts/SQLEditorLayout/SqlEditor.Commands' |
| 26 | import { useProjectLevelTableEditorCommands } from '@/components/layouts/TableEditorLayout/TableEditor.Commands' |
| 27 | import { useLayoutNavCommands } from '@/components/layouts/useLayoutNavCommands' |
| 28 | |
| 29 | export function CommandMenuInnerContent() { |
| 30 | return ( |
| 31 | <> |
| 32 | <CommandHeader> |
| 33 | <CommandMenuInput /> |
| 34 | </CommandHeader> |
| 35 | <CommandMenuList /> |
| 36 | </> |
| 37 | ) |
| 38 | } |
| 39 | |
| 40 | export default function StudioCommandMenu() { |
| 41 | useCreateCommands() |
| 42 | useApiKeysCommands() |
| 43 | useApiUrlCommand() |
| 44 | useConnectCommands() |
| 45 | useProjectLevelTableEditorCommands() |
| 46 | useProjectSwitchCommand() |
| 47 | useConfigureOrganizationCommand() |
| 48 | useQueryTableCommands() |
| 49 | useBranchCommands() |
| 50 | useSnippetCommands() |
| 51 | useLayoutNavCommands() |
| 52 | useDocsSearchCommands({ |
| 53 | options: { orderSection: orderCommandSectionsByPriority, sectionMeta: { priority: 3 } }, |
| 54 | }) |
| 55 | useDocsAiCommands({ |
| 56 | options: { orderSection: orderCommandSectionsByPriority, sectionMeta: { priority: 3 } }, |
| 57 | }) |
| 58 | useSupportCommands() |
| 59 | useChangelogCommand({ enabled: IS_PLATFORM }) |
| 60 | useThemeSwitcherCommands() |
| 61 | useContextSearchCommands() |
| 62 | |
| 63 | return ( |
| 64 | <CommandMenu> |
| 65 | <CommandMenuInnerContent /> |
| 66 | </CommandMenu> |
| 67 | ) |
| 68 | } |