update
This commit is contained in:
29
Frontend/src/components/common/CookiePreferencesLink.tsx
Normal file
29
Frontend/src/components/common/CookiePreferencesLink.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
import React from 'react';
|
||||
import { useCookieConsent } from '../../contexts/CookieConsentContext';
|
||||
|
||||
const CookiePreferencesLink: React.FC = () => {
|
||||
const { hasDecided } = useCookieConsent();
|
||||
|
||||
if (!hasDecided) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const handleClick = () => {
|
||||
// Dispatch a custom event listened by the banner to reopen details.
|
||||
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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user