mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 22:26:13 +00:00
The root layout now reads the public monitoring switches while it renders, so nothing calls GET /api/monitoring/settings any more (the native client never did); the route and its unpublished entry in the route coverage guard go. The Coach feedback card reads the AI quality card's cell, which left queryKeys.adminCoachFeedback() without a reader.
31 lines
923 B
TypeScript
31 lines
923 B
TypeScript
import { UmamiScript } from "@/components/monitoring/umami-script";
|
|
import { GlitchtipReporter } from "@/components/monitoring/glitchtip-reporter";
|
|
import type { PublicMonitoringSettings } from "@/lib/monitoring-settings";
|
|
|
|
/**
|
|
* Mounts the operator's analytics script and error reporter. The root layout
|
|
* reads the instance-wide switches on the server and passes them in, so no
|
|
* page load asks for three values the document render already has. `null`
|
|
* (the key-mismatch page) mounts nothing.
|
|
*/
|
|
export function MonitoringBootstrap({
|
|
settings,
|
|
}: {
|
|
settings: Pick<
|
|
PublicMonitoringSettings,
|
|
"umamiEnabled" | "umamiWebsiteId" | "glitchtipEnabled"
|
|
> | null;
|
|
}) {
|
|
if (!settings) return null;
|
|
|
|
return (
|
|
<>
|
|
<UmamiScript
|
|
enabled={settings.umamiEnabled}
|
|
websiteId={settings.umamiWebsiteId}
|
|
/>
|
|
<GlitchtipReporter enabled={settings.glitchtipEnabled} />
|
|
</>
|
|
);
|
|
}
|