"use client"; /** * Settings → AI section wrapper. * * v1.16.4 — the former 2k-LOC monolith is split into per-provider * subcomponents under `src/components/settings/ai/` (one file per * provider form, plus the chain / runtime cards). This file only owns * the section frame and the card order; behaviour lives in the parts. * * v1.18.0 (S5) — the Coach preference cards (disable toggle, preferences, * memory) moved out to the dedicated Coach section. The AI section keeps * only provider / model / BYOK configuration. * * v1.18.1 (D8) — the "About me" context moved to Settings → Account (under * Profil, before Zyklus-Tracking). It is personal medical context the daily * briefing reads too, so it belongs with the account profile rather than the * provider-configuration screen. */ import { AiInsightsCard } from "@/components/settings/ai/ai-insights-card"; import { useAuth } from "@/hooks/use-auth"; import { useMounted } from "@/hooks/use-mounted"; export function AiSection() { const { isAuthenticated } = useAuth(); // v1.16.6 — the auth query can resolve before this boundary // hydrates; every `disabled={!isAuthenticated}` binding in the child // cards would then disagree with the SSR HTML (React #418). Gate the // prop on `useMounted()` so the hydration render matches the // server-rendered "not yet authenticated" state and the cards enable // on the first client re-render. const mounted = useMounted(); const authed = mounted && isAuthenticated; // v1.18.6 (W9) — the visible heading + subtitle now come from the shared // `` in the route; this body is the single provider // card. (The "About me" context moved to Settings → Account in v1.18.1 D8.) return ; }