Add GoogleMapsEmbed.tsx — consent-gated Maps embed, prepared but unused

Uses Klaro's own built-in contextual-consent mechanism (not
loadTrackingCode.ts's script-injection path) — the iframe renders
with data-name="google-maps" and its real src; Klaro's DOM scan finds
it after mount and blanks/restores src based on that service's
consent state, showing its own placeholder (styled via
KlaroConsentManager.tsx's KlaroTheme) in the meantime.

No map embedded anywhere in the app yet — this is prep work only, per
explicit request ahead of an actual page needing one.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Marco
2026-08-01 21:58:19 +00:00
parent 417bbd430e
commit ac6c3d6b71
6 changed files with 122 additions and 2 deletions
+6
View File
@@ -23,6 +23,12 @@ function injectScript(id: string, src?: string, inlineJs?: string) {
// only one whose content is admin-supplied rather than a fixed snippet
// (trusted deliberately, see TrackingCodes.ts on the backend).
export function loadTrackingCode(code: TrackingCode): void {
// No-op — Google Maps isn't a script this app injects. Klaro's own
// contextual-consent DOM scan handles any `data-name="google-maps"`
// iframe (GoogleMapsEmbed.tsx) independently, purely off the service's
// consent state — see klaroConfig.ts's own comment on this service.
if (code.provider === "google-maps") return;
const baseId = `tracking-code-${code.id}`;
if (code.provider === "google-analytics" && code.measurementId) {