MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / useAppContext

Function useAppContext

apps/start/src/hooks/use-app-context.ts:3–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import { useRouteContext } from '@tanstack/react-router';
2
3export function useAppContext() {
4 const params = useRouteContext({
5 strict: false,
6 });
7
8 if (
9 !(params.apiUrl && params.dashboardUrl) ||
10 typeof params.isSelfHosted === 'undefined'
11 ) {
12 throw new Error('API URL or dashboard URL is not set');
13 }
14
15 return {
16 apiUrl: params.apiUrl,
17 dashboardUrl: params.dashboardUrl,
18 isSelfHosted: params.isSelfHosted,
19 isMaintenance: params.isMaintenance ?? false,
20 isDemo: params.isDemo ?? false,
21 };
22}

Callers 15

SidebarOrganizationMenuFunction · 0.90
LoginNavbarFunction · 0.90
SidebarContainerFunction · 0.90
PagesInsightsFunction · 0.90
GscCannibalizationFunction · 0.90
ImageIconFunction · 0.90
ConnectWebFunction · 0.90
VerifyFaqFunction · 0.90
useColumnsFunction · 0.90
ChatRuntimeProviderFunction · 0.90
SupporterPromptFunction · 0.90
FeedbackPromptFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected