Files
supabase/apps/studio/components/interfaces/App/CommandMenu/Support.tsx
Charis 84732ff44c feat: add new command menu to studio (#28432)
Add new command menu to studio. Ports over commands from old menu (with some minor reorganization), then adds:
- Branch switcher
- Project switcher
2024-08-08 16:42:07 -04:00

42 lines
1.2 KiB
TypeScript

import { LifeBuoy } from 'lucide-react'
import { useMemo } from 'react'
import { IS_PLATFORM } from 'common'
import type { ICommand } from 'ui-patterns/CommandMenu'
import { useRegisterCommands } from 'ui-patterns/CommandMenu'
import { COMMAND_MENU_SECTIONS } from './CommandMenu.utils'
const useSupportCommands = () => {
const commands = useMemo(
() =>
[
{
id: 'support',
name: 'Support',
route: 'https://www.supabase.com/support',
icon: () => <LifeBuoy />,
},
{
id: 'system-status',
name: 'System Status',
value: 'Support: System Status',
route: 'https://status.supabase.com',
icon: () => <LifeBuoy />,
},
{
id: 'github-discussions',
name: 'GitHub Discussions',
value: 'Support: GitHub Discussions',
route: 'https://github.com/orgs/supabase/discussions',
icon: () => <LifeBuoy />,
defaultHidden: true,
},
] as Array<ICommand>,
[]
)
useRegisterCommands(COMMAND_MENU_SECTIONS.SUPPORT, commands, { enabled: IS_PLATFORM })
}
export { useSupportCommands }