Loading...
Generate GDPR-compliant cookie consent banners with visual customization
'use client';
import { useState, useEffect } from 'react';
export function CookieConsent() {
const [isOpen, setIsOpen] = useState(false);
useEffect(() => {
if (!localStorage.getItem('cookie_consent_next_devutilities')) {
setIsOpen(true);
}
}, []);
const handleAccept = () => {
localStorage.setItem('cookie_consent_next_devutilities', 'granted');
setIsOpen(false);
};
if (!isOpen) return null;
return (
<div className="fixed bottom-4 right-4 max-w-md p-4 rounded-xl shadow-2xl border bg-zinc-900 text-white z-50">
<h4 className="font-bold text-sm mb-1">We value your privacy & transparency</h4>
<p className="text-xs text-zinc-400 mb-3">We use cookies and analytics to enhance your experience, measure performance, and keep our developer tools fast and secure.</p>
<div className="flex items-center gap-2">
<button onClick={handleAccept} className="px-3 py-1.5 bg-primary text-white text-xs font-semibold rounded-md">
Accept All
</button>
</div>
</div>
);
}