mirror of
https://github.com/supabase/supabase.git
synced 2026-06-13 10:09:12 +08:00
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import { useParams } from 'common'
|
|
import type { CommandOptions } from 'ui-patterns/CommandMenu'
|
|
import { useRegisterCommands } from 'ui-patterns/CommandMenu'
|
|
|
|
import { COMMAND_MENU_SECTIONS } from '../App/CommandMenu/CommandMenu.utils'
|
|
|
|
export function useApiDocsGotoCommands(options?: CommandOptions) {
|
|
let { ref } = useParams()
|
|
ref ||= '_'
|
|
|
|
useRegisterCommands(
|
|
COMMAND_MENU_SECTIONS.NAVIGATE,
|
|
[
|
|
{
|
|
id: 'nav-api',
|
|
name: 'Project API Docs',
|
|
route: `/project/${ref}/integrations/data_api/docs`,
|
|
defaultHidden: true,
|
|
},
|
|
{
|
|
id: 'nav-api-auth',
|
|
name: 'Auth Docs',
|
|
route: `/project/${ref}/integrations/data_api/docs?page=auth`,
|
|
defaultHidden: true,
|
|
},
|
|
{
|
|
id: 'nav-api-user-management',
|
|
name: 'User Management Docs',
|
|
route: `/project/${ref}/integrations/data_api/docs?page=users-management`,
|
|
defaultHidden: true,
|
|
},
|
|
{
|
|
id: 'nav-api-graphql',
|
|
name: 'GraphQL Docs',
|
|
route: `/project/${ref}/integrations/graphiql`,
|
|
defaultHidden: true,
|
|
},
|
|
],
|
|
{ ...options, deps: [ref] }
|
|
)
|
|
}
|