mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
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.
35 lines
934 B
TypeScript
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);
|