EdgeFunctions.Commands.tsx23 lines · main
| 1 | import { useParams } from 'common' |
| 2 | import type { CommandOptions } from 'ui-patterns/CommandMenu' |
| 3 | import { useRegisterCommands } from 'ui-patterns/CommandMenu' |
| 4 | |
| 5 | import { COMMAND_MENU_SECTIONS } from '@/components/interfaces/App/CommandMenu/CommandMenu.utils' |
| 6 | |
| 7 | export 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 | } |