IntegrationsMenu.utils.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import type { ProductMenuGroup } from '@/components/ui/ProductMenu/ProductMenu.types'
  2. export function generateIntegrationsMenu({
  3. projectRef,
  4. flags,
  5. }: {
  6. projectRef?: string
  7. flags?: { showWrappers: boolean }
  8. }): ProductMenuGroup[] {
  9. const { showWrappers } = flags ?? {}
  10. return [
  11. {
  12. title: 'Explore',
  13. items: [
  14. {
  15. name: 'All',
  16. key: 'integrations',
  17. url: `/project/${projectRef}/integrations`,
  18. pages: ['integrations'],
  19. items: [],
  20. },
  21. ...(showWrappers
  22. ? [
  23. {
  24. name: 'Wrappers',
  25. key: 'integrations-wrapper',
  26. url: `/project/${projectRef}/integrations?category=wrapper`,
  27. pages: ['integrations?category=wrapper'],
  28. items: [],
  29. },
  30. ]
  31. : []),
  32. {
  33. name: 'Postgres Modules',
  34. key: 'integrations-postgres_extension',
  35. url: `/project/${projectRef}/integrations?category=postgres_extension`,
  36. pages: ['integrations?category=postgres_extension'],
  37. items: [],
  38. },
  39. ],
  40. },
  41. ]
  42. }