EdgeFunctions.Commands.tsx23 lines · main
1import { useParams } from 'common'
2import type { CommandOptions } from 'ui-patterns/CommandMenu'
3import { useRegisterCommands } from 'ui-patterns/CommandMenu'
4
5import { COMMAND_MENU_SECTIONS } from '@/components/interfaces/App/CommandMenu/CommandMenu.utils'
6
7export function useFunctionsGotoCommands(options?: CommandOptions) {
8 let { ref } = useParams()
9 ref ||= '_'
10
11 useRegisterCommands(
12 COMMAND_MENU_SECTIONS.NAVIGATE,
13 [
14 {
15 id: 'nav-functions',
16 name: 'Edge Functions',
17 route: `/project/${ref}/functions`,
18 defaultHidden: true,
19 },
20 ],
21 { ...options, deps: [ref] }
22 )
23}