Files
explore/ui/shared/HanzoInsights.tsx
zeekay e9756e8814 run on the native fleet
Adds .hanzo/workflows/cicd.yml calling the canonical pipeline and drops the
GitHub-hosted workflows it replaces. Lands here because this is where the repo
is written — git.hanzo.ai is upstream and github.com is its push mirror, so the
same change made on github.com never reaches the runner fleet.
2026-08-20 20:20:18 -07:00

35 lines
934 B
TypeScript

import { AnalyticsProvider, usePageview } from '@hanzo/event/react';
import { useRouter } from 'next/router';
import React from 'react';
import config from 'configs/app';
const feature = config.features.hanzoInsights;
// The provider records the first pageview when it mounts. A client-side route
// change never remounts it, so this records every pageview after the first.
const RouteTrackerContent = () => {
const router = useRouter();
usePageview(router.asPath);
return null;
};
const RouteTracker = React.memo(RouteTrackerContent);
const HanzoInsights = () => {
if (!feature.isEnabled) {
return null;
}
return (
// Errors stay with Rollbar, which this app already runs — one reporter, not two.
<AnalyticsProvider config={{ product: 'explore', ingestKey: feature.ingestKey, captureErrors: false }}>
<RouteTracker/>
</AnalyticsProvider>
);
};
export default React.memo(HanzoInsights);