UNPKG

urbi-exhibitions

Version:
49 lines (48 loc) 1.03 kB
import { jsx as n } from "react/jsx-runtime"; import { createContext as r, useContext as s, useState as i, useMemo as l } from "react"; const a = r({ enabled: !1, setEnabled: () => { } }); function m() { const o = s(a); if (o === void 0) throw new Error("useClockContext must be used within an ClockProvider"); return o; } const u = ({ children: o }) => { const [e, t] = i(!1), d = l( () => ({ enabled: e, setEnabled: t }), [e] ); return /* @__PURE__ */ n(a.Provider, { value: d, children: o }); }; u.displayName = "ClockProvider"; const c = r( void 0 ); function f() { const o = s(c); if (o === void 0) throw new Error( "useGeolocationContext must be used within an GeolocationProvider" ); return o; } const C = ({ children: o }) => { const [e, t] = i(void 0); return /* @__PURE__ */ n(c.Provider, { value: { coordinates: e, setCoordinates: t }, children: o }); }; C.displayName = "GeolocationProvider"; export { u as C, C as G, f as a, m as u };