function CookieBanner({ lang }) { const [visible, setVisible] = React.useState(false); const [showDetails, setShowDetails] = React.useState(false); const [prefs, setPrefs] = React.useState({ essential: true, analytics: false, marketing: false }); React.useEffect(() => { const consent = localStorage.getItem('gs_cookie_consent'); if (!consent) setVisible(true); }, []); const accept = (all) => { const choice = all ? { essential: true, analytics: true, marketing: true } : prefs; localStorage.setItem('gs_cookie_consent', JSON.stringify({ ...choice, ts: Date.now() })); setVisible(false); }; const reject = () => { localStorage.setItem('gs_cookie_consent', JSON.stringify({ essential: true, analytics: false, marketing: false, ts: Date.now() })); setVisible(false); }; if (!visible) return null; const T = { EN: { title: 'Your privacy, our responsibility.', body: 'We use cookies and similar technologies to operate this website. Some are essential for the site to function; others help us understand how you use it. Under the DSGVO (German Federal Data Protection Act / GDPR), you have the right to choose which cookies we set.', essential: 'Essential', essentialNote: 'Always active — required for basic site function.', analytics: 'Analytics', analyticsNote: 'Help us understand how visitors interact with the site.', marketing: 'Marketing', marketingNote: 'Used to show relevant content and measure campaign effectiveness.', acceptAll: 'Accept all', savePrefs: 'Save preferences', rejectAll: 'Essential only', details: 'Customise', hideDetails: 'Hide details', privacy: 'Privacy Policy', imprint: 'Imprint', note: 'You can withdraw or change your consent at any time via the footer.', }, DE: { title: 'Ihre Privatsphäre, unsere Verantwortung.', body: 'Wir verwenden Cookies und ähnliche Technologien, um diese Website zu betreiben. Einige sind für den Betrieb der Seite notwendig; andere helfen uns zu verstehen, wie Sie die Seite nutzen. Gemäß DSGVO haben Sie das Recht zu wählen, welche Cookies wir setzen.', essential: 'Essenziell', essentialNote: 'Immer aktiv – für grundlegende Seitenfunktionen erforderlich.', analytics: 'Analyse', analyticsNote: 'Helfen uns zu verstehen, wie Besucher mit der Seite interagieren.', marketing: 'Marketing', marketingNote: 'Zur Anzeige relevanter Inhalte und Erfolgsmessung von Kampagnen.', acceptAll: 'Alle akzeptieren', savePrefs: 'Einstellungen speichern', rejectAll: 'Nur Essenziell', details: 'Anpassen', hideDetails: 'Ausblenden', privacy: 'Datenschutzerklärung', imprint: 'Impressum', note: 'Sie können Ihre Einwilligung jederzeit über die Fußzeile widerrufen oder ändern.', }, }; const t = T[lang] || T.EN; return (
{/* Top accent */}
DSGVO · GDPR

{t.title}

{t.body}

{/* Buttons */}
{/* Detailed prefs */} {showDetails && (
{[ { key: 'essential', label: t.essential, note: t.essentialNote, locked: true }, { key: 'analytics', label: t.analytics, note: t.analyticsNote, locked: false }, { key: 'marketing', label: t.marketing, note: t.marketingNote, locked: false }, ].map((item) => (
{item.label}
{item.note}
!item.locked && setPrefs(p => ({...p, [item.key]: !p[item.key]}))} style={{ width: 44, height: 24, borderRadius: 999, background: (item.locked || prefs[item.key]) ? 'var(--gs-900)' : 'var(--gs-200)', position: 'relative', cursor: item.locked ? 'default' : 'pointer', transition: 'background 200ms', flexShrink: 0, }}>
))}
)} {/* Footer links */}
); } window.CookieBanner = CookieBanner;