mirror of
https://github.com/supabase/supabase.git
synced 2026-07-03 10:14:22 +08:00
Add new command menu to studio. Ports over commands from old menu (with some minor reorganization), then adds: - Branch switcher - Project switcher
42 lines
1.2 KiB
TypeScript
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 }
|