@devgateway/dvz-ui-react
Version:
A modular, embeddable React component library for data visualization and UI, built with TypeScript. Provides reusable components for charts, maps, dashboards, and more, with built-in support for internationalization and Redux integration.
2 lines (1 loc) • 632 B
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),c=require("react"),i=require("react-ga4"),g=require("react-router"),C=require("../conf/index.js"),l=require("@devgateway/wp-react-lib"),d=(r,p={})=>a=>{var n;const e=c.useContext(l.SettingsContext)??{},t=((n=e==null?void 0:e.data)==null?void 0:n.google_analytics_code)??C.Config.GA_CODE;console.log("gaCode",t);const o=g.useLocation();return i.initialize(t??"#REACT_APP_GA_CODE#"),c.useEffect(()=>{if(t){const s=o.pathname;i.send({hitType:"pageview",page:s})}},[o.pathname]),u.jsx(r,{...a})};exports.withTracker=d;