29 lines
594 B
TypeScript
29 lines
594 B
TypeScript
import React from 'react';
|
|
import { useCookieConsent } from '../../contexts/CookieConsentContext';
|
|
|
|
const CookiePreferencesLink: React.FC = () => {
|
|
const { hasDecided } = useCookieConsent();
|
|
|
|
if (!hasDecided) {
|
|
return null;
|
|
}
|
|
|
|
const handleClick = () => {
|
|
|
|
window.dispatchEvent(new CustomEvent('open-cookie-preferences'));
|
|
};
|
|
|
|
return (
|
|
<button
|
|
type="button"
|
|
onClick={handleClick}
|
|
className="text-xs font-medium text-gray-500 underline hover:text-gray-700"
|
|
>
|
|
Cookie preferences
|
|
</button>
|
|
);
|
|
};
|
|
|
|
export default CookiePreferencesLink;
|
|
|