UNPKG

@wener/console

Version:

Base console UI toolkit

24 lines (23 loc) 953 B
import React, { lazy } from "react"; import { ProdOnly } from "@wener/reaction"; import { useShallow } from "zustand/react/shallow"; import { useUserId } from "../../console/context.js"; import { useSiteStore } from "./SiteStore.js"; // avoid browser block the js cause app failed to load const MatomoTracker = /*#__PURE__*/ lazy(() => import("../../matomo/MatomoTracker.js").then((m) => ({ default: m.MatomoTracker }))); export const SiteSidecar = () => { const { url, siteId } = useSiteStore(useShallow((s) => { return { url: s.metadata?.matomoUrl, siteId: s.metadata?.matomoSiteId }; })); return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(ProdOnly, null, siteId && url && /*#__PURE__*/ React.createElement(MatomoTracker, { url: url, siteId: siteId, useUserId: useUserId }))); }; //# sourceMappingURL=SiteSidecar.js.map