Support.tsx 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { IS_PLATFORM } from 'common'
  2. import { Activity, LifeBuoy } from 'lucide-react'
  3. import { useMemo } from 'react'
  4. import type { ICommand } from 'ui-patterns/CommandMenu'
  5. import { useRegisterCommands } from 'ui-patterns/CommandMenu'
  6. import { COMMAND_MENU_SECTIONS } from './CommandMenu.utils'
  7. export const useSupportCommands = () => {
  8. const commands = useMemo(
  9. () =>
  10. [
  11. {
  12. id: 'system-status',
  13. name: 'View system status',
  14. value: 'Support: View system status',
  15. route: 'https://status.supabase.com',
  16. icon: () => <Activity />,
  17. },
  18. {
  19. id: 'discord-community',
  20. name: 'Ask Discord community',
  21. value: 'Support: Ask Discord community',
  22. route: 'https://discord.supabase.com',
  23. icon: () => <LifeBuoy />,
  24. },
  25. {
  26. id: 'support-team',
  27. name: 'Contact support',
  28. value: 'Support: Contact support',
  29. route: 'https://www.supabase.com/support',
  30. icon: () => <LifeBuoy />,
  31. },
  32. ] as Array<ICommand>,
  33. []
  34. )
  35. useRegisterCommands(COMMAND_MENU_SECTIONS.SUPPORT, commands, { enabled: IS_PLATFORM })
  36. }