'use client'; import React, { useState, useEffect } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { useCookieConsent, CookiePreferences } from './CookieConsentContext'; // Cookie type definitions interface CookieType { id: keyof CookiePreferences; name: string; description: string; required: boolean; icon: string; } const cookieTypes: CookieType[] = [ { id: 'necessary', name: 'Necessary Cookies', description: 'Essential cookies required for the website to function properly. These cannot be disabled.', required: true, icon: 'fas fa-shield-alt', }, { id: 'functional', name: 'Functional Cookies', description: 'These cookies enable enhanced functionality and personalization, such as remembering your preferences.', required: false, icon: 'fas fa-cogs', }, ]; // Main Cookie Consent Banner Component export const CookieConsentBanner: React.FC = () => { const { state, config, acceptAll, acceptNecessary, showSettings } = useCookieConsent(); const [isVisible, setIsVisible] = useState(false); useEffect(() => { if (state.showBanner) { // Small delay to ensure smooth animation const timer = setTimeout(() => setIsVisible(true), 100); return () => clearTimeout(timer); } else { setIsVisible(false); } }, [state.showBanner]); if (!state.showBanner || !isVisible) return null; return ( {/* Fullscreen overlay to center the banner */} {/* Centered enterprise-style card */}

Cookie Preferences

We use only essential functional cookies to ensure our website works properly. We do not collect personal data or use tracking cookies. Your privacy is important to us.

{config.showPrivacyNotice && ( )}
); }; // Cookie Settings Modal Component export const CookieSettingsModal: React.FC = () => { const { state, config, hideSettings, acceptSelected, updatePreferences, withdrawConsent, exportConsentData } = useCookieConsent(); const [tempPreferences, setTempPreferences] = useState(state.preferences); useEffect(() => { setTempPreferences(state.preferences); }, [state.preferences]); const handlePreferenceChange = (type: keyof CookiePreferences, value: boolean) => { if (type === 'necessary') return; // Cannot change necessary cookies setTempPreferences(prev => ({ ...prev, [type]: value, })); }; const handleSavePreferences = () => { acceptSelected(tempPreferences); }; const handleAcceptAll = () => { const allAccepted: CookiePreferences = { necessary: true, functional: true, }; acceptSelected(allAccepted); }; if (!state.showSettings) return null; return ( e.stopPropagation()} >

Cookie Preferences

v{config.version}

We respect your privacy and only use essential functional cookies. You can choose which types of cookies to allow below.

{cookieTypes.map((cookieType) => (

{cookieType.name}

{cookieType.description}

))}

Privacy Information

  • We do not collect personal data without your explicit consent
  • Functional cookies are used only to maintain website functionality
  • We do not use tracking, analytics, or marketing cookies
  • You can change your preferences at any time
  • Data retention period: {config.retentionPeriod} days
  • Contact: {config.dataControllerEmail}
{config.enableDetailedSettings && (

Enterprise Features

)}
); }; // Main Cookie Consent Component that combines both banner and modal export const CookieConsent: React.FC = () => { return ( <> ); }; // Cookie Preferences Display Component (for footer or privacy page) export const CookiePreferencesDisplay: React.FC = () => { const { state, showSettings, resetConsent } = useCookieConsent(); return (

Cookie Preferences

Status: {state.hasConsented ? 'Consent Given' : 'No Consent'}

Functional Cookies: {state.preferences.functional ? 'Enabled' : 'Disabled'}

); };