Home / Function/ useConfigureOrganizationCommand() — supabase Function Reference

useConfigureOrganizationCommand() — supabase Function Reference

Architecture documentation for the useConfigureOrganizationCommand() function in OrgProjectSwitcher.tsx from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  a9d33395_a898_1775_a16c_7fcd0da125db["useConfigureOrganizationCommand()"]
  7902296a_39c1_2b01_0b22_d5c1b0ad688b["StudioCommandMenu()"]
  7902296a_39c1_2b01_0b22_d5c1b0ad688b -->|calls| a9d33395_a898_1775_a16c_7fcd0da125db
  style a9d33395_a898_1775_a16c_7fcd0da125db fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/studio/components/interfaces/App/CommandMenu/OrgProjectSwitcher.tsx lines 58–98

export function useConfigureOrganizationCommand() {
  const setPage = useSetPage()

  const { data: organizations } = useOrganizationsQuery({ enabled: IS_PLATFORM })

  useRegisterPage(
    ORGANIZATION_SWITCHER_PAGE_NAME,
    {
      type: PageType.Commands,
      sections: [
        {
          id: 'configure-organization',
          name: 'Configure organization',
          commands:
            organizations?.map(({ name, slug }) => ({
              id: `organization-${slug}`,
              name,
              value: `${name} (${slug})`,
              route: `/org/${slug}/general`,
              icon: () => <Building />,
            })) ?? [],
        },
      ],
    },
    { deps: [organizations], enabled: !!organizations && organizations.length > 0 }
  )

  useRegisterCommands(
    COMMAND_MENU_SECTIONS.ACTIONS,
    [
      {
        id: 'configure-organization',
        name: 'Configure organization...',
        value: 'Configure organization, Change organization, Select organization',
        action: () => setPage(ORGANIZATION_SWITCHER_PAGE_NAME),
        icon: () => <Building />,
      },
    ],
    { enabled: !!organizations && organizations.length > 0 }
  )
}

Subdomains

Frequently Asked Questions

What does useConfigureOrganizationCommand() do?
useConfigureOrganizationCommand() is a function in the supabase codebase.
What calls useConfigureOrganizationCommand()?
useConfigureOrganizationCommand() is called by 1 function(s): StudioCommandMenu.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free