import React, { useEffect, useState } from 'react'; import { useCookieConsent } from '../contexts/CookieConsentContext'; import { Link } from 'react-router-dom'; const CookieConsentBanner: React.FC = () => { const { consent, isLoading, hasDecided, updateConsent } = useCookieConsent(); const [showDetails, setShowDetails] = useState(false); const [analyticsChecked, setAnalyticsChecked] = useState(false); const [marketingChecked, setMarketingChecked] = useState(false); const [preferencesChecked, setPreferencesChecked] = useState(false); useEffect(() => { if (consent) { setAnalyticsChecked(consent.categories.analytics); setMarketingChecked(consent.categories.marketing); setPreferencesChecked(consent.categories.preferences); } }, [consent]); useEffect(() => { const handleOpenPreferences = () => { setShowDetails(true); }; window.addEventListener('open-cookie-preferences', handleOpenPreferences); return () => { window.removeEventListener( 'open-cookie-preferences', handleOpenPreferences ); }; }, []); if (isLoading || hasDecided) { return null; } const handleAcceptAll = async () => { await updateConsent({ analytics: true, marketing: true, preferences: true, }); }; const handleRejectNonEssential = async () => { await updateConsent({ analytics: false, marketing: false, preferences: false, }); }; const handleSaveSelection = async () => { await updateConsent({ analytics: analyticsChecked, marketing: marketingChecked, preferences: preferencesChecked, }); }; return (
{}
{}
{}
Privacy Suite

A tailored privacy experience

We use cookies to ensure a seamless booking journey, enhance performance, and offer curated experiences. Choose a level of personalization that matches your comfort.

Data Privacy (GDPR)
{showDetails && (

Strictly necessary

Essential for security, authentication, and core booking flows. These are always enabled.

setAnalyticsChecked(e.target.checked)} />
setMarketingChecked(e.target.checked)} />
setPreferencesChecked(e.target.checked)} />
)}
{}
{showDetails && ( )}
); }; export default CookieConsentBanner;