MCPcopy
hub / github.com/calcom/cal.diy / useEmbedParams

Function useEmbedParams

packages/features/embed/lib/hooks/useEmbedParams.ts:16–39  ·  view source on GitHub ↗
(noQueryParamMode = false)

Source from the content-addressed store, hash-verified

14};
15
16export function useEmbedParams(noQueryParamMode = false): EmbedParams {
17 const searchParams = useCompatSearchParams();
18 const { embedState } = useEmbedDialogCtx(noQueryParamMode);
19
20 return noQueryParamMode
21 ? {
22 embedType: embedState?.embedType ?? null,
23 embedUrl: embedState?.embedUrl ?? "",
24 namespace: embedState?.namespace ?? "",
25 embedTabName: embedState?.embedTabName ?? null,
26 eventId: embedState?.eventId ?? null,
27 date: embedState?.date ?? null,
28 month: embedState?.month ?? null,
29 }
30 : {
31 embedType: (searchParams?.get("embedType") as EmbedType) ?? null,
32 embedUrl: (searchParams?.get("embedUrl") || "") as string,
33 namespace: (searchParams?.get("namespace") || "") as string,
34 embedTabName: (searchParams?.get("embedTabName") || "") as string,
35 eventId: (searchParams?.get("eventId") || "") as string,
36 date: (searchParams?.get("date") || "") as string,
37 month: (searchParams?.get("month") || "") as string,
38 };
39}

Callers 2

EmbedDialogFunction · 0.90

Calls 3

useCompatSearchParamsFunction · 0.90
useEmbedDialogCtxFunction · 0.90
getMethod · 0.65

Tested by

no test coverage detected