EdgeFunctions.Commands.tsx 632 B

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