Support.tsx39 lines · main
| 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 | |
| 7 | import { COMMAND_MENU_SECTIONS } from './CommandMenu.utils' |
| 8 | |
| 9 | export const useSupportCommands = () => { |
| 10 | const commands = useMemo( |
| 11 | () => |
| 12 | [ |
| 13 | { |
| 14 | id: 'system-status', |
| 15 | name: 'View system status', |
| 16 | value: 'Support: View system status', |
| 17 | route: 'https://status.supabase.com', |
| 18 | icon: () => <Activity />, |
| 19 | }, |
| 20 | { |
| 21 | id: 'discord-community', |
| 22 | name: 'Ask Discord community', |
| 23 | value: 'Support: Ask Discord community', |
| 24 | route: 'https://discord.supabase.com', |
| 25 | icon: () => <LifeBuoy />, |
| 26 | }, |
| 27 | { |
| 28 | id: 'support-team', |
| 29 | name: 'Contact support', |
| 30 | value: 'Support: Contact support', |
| 31 | route: 'https://www.supabase.com/support', |
| 32 | icon: () => <LifeBuoy />, |
| 33 | }, |
| 34 | ] as Array<ICommand>, |
| 35 | [] |
| 36 | ) |
| 37 | |
| 38 | useRegisterCommands(COMMAND_MENU_SECTIONS.SUPPORT, commands, { enabled: IS_PLATFORM }) |
| 39 | } |