Files
calendar/apps/web/app/GeoContext.tsx
T
Amit SharmaGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
9048d053ac feat: posthog version upgrade and added trackings (#24401)
* posthog version upgrade and calai banner tracking

* disable posthog for EU

* bunch more posthog tracking

* Revert yarn.lock changes

* add posthog package yarn changes

* fix: add missing posthog import and fix lint warning in MemberInvitationModal

Co-Authored-By: amit@cal.com <samit91848@gmail.com>

* fix: type check

* cubic fixes

* refactor

* remove ui playground

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2025-11-28 12:43:37 +00:00

28 lines
579 B
TypeScript

"use client";
import { createContext, useContext } from "react";
interface GeoContextValue {
country: string;
}
const GeoContext = createContext<GeoContextValue | undefined>(undefined);
export function GeoProvider({
country,
children,
}: {
country: string;
children: React.ReactNode;
}) {
return <GeoContext.Provider value={{ country }}>{children}</GeoContext.Provider>;
}
export function useGeo() {
const context = useContext(GeoContext);
if (context === undefined) {
throw new Error("useGeo must be used within a GeoProvider");
}
return context;
}