urbi-exhibitions
Version:
2 lines (1 loc) • 878 B
JavaScript
;const r=require("react/jsx-runtime"),o=require("react"),s=o.createContext({enabled:!1,setEnabled:()=>{}});function l(){const e=o.useContext(s);if(e===void 0)throw new Error("useClockContext must be used within an ClockProvider");return e}const i=({children:e})=>{const[t,n]=o.useState(!1),u=o.useMemo(()=>({enabled:t,setEnabled:n}),[t]);return r.jsx(s.Provider,{value:u,children:e})};i.displayName="ClockProvider";const c=o.createContext(void 0);function d(){const e=o.useContext(c);if(e===void 0)throw new Error("useGeolocationContext must be used within an GeolocationProvider");return e}const a=({children:e})=>{const[t,n]=o.useState(void 0);return r.jsx(c.Provider,{value:{coordinates:t,setCoordinates:n},children:e})};a.displayName="GeolocationProvider";exports.ClockProvider=i;exports.GeolocationProvider=a;exports.useClockContext=l;exports.useGeolocation=d;