9048d053ac
* 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>
28 lines
579 B
TypeScript
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;
|
|
}
|