Files
HiveGrid-Wireframes/03 Quellen und Referenzen/hivegrid-website/components/dev/AgentationClient.tsx
T

27 lines
864 B
TypeScript

"use client";
import dynamic from "next/dynamic";
const Agentation = dynamic(
() => import("agentation").then((module) => module.Agentation),
{ ssr: false }
);
export default function AgentationClient() {
if (process.env.NODE_ENV !== "development") {
return null;
}
// Opt-in only: the agentation overlay monkey-patches global timers
// (setInterval / setTimeout / requestAnimationFrame) and runs on every page.
// Combined with the site's GSAP + ResizeObserver/rAF loops this can spin the
// dev tab into a CPU/RAM runaway that swap-storms the whole machine.
// Enable explicitly with NEXT_PUBLIC_AGENTATION=1 only when the agent
// backend on localhost:4747 is actually running.
if (process.env.NEXT_PUBLIC_AGENTATION !== "1") {
return null;
}
return <Agentation endpoint="http://localhost:4747" className="z-[9999]" />;
}