'use client' import React, { useState, useEffect } from 'react' import Link from 'next/link' import { useParams } from 'next/navigation' import { Cookie, X, ShieldCheck } from 'lucide-react' export default function CookieBanner() { const [mounted, setMounted] = useState(false) const [visible, setVisible] = useState(false) const params = useParams() const locale = (params?.locale as string) || 'tr' useEffect(() => { setMounted(true) const consent = localStorage.getItem('ayris_cookie_consent') if (!consent) { // Sayfa yüklendikten kısa bir süre sonra pürüzsüzce aç const timer = setTimeout(() => { setVisible(true) }, 1000) return () => clearTimeout(timer) } }, []) const handleAcceptAll = () => { localStorage.setItem('ayris_cookie_consent', 'accepted_all') setVisible(false) } const handleAcceptEssential = () => { localStorage.setItem('ayris_cookie_consent', 'essential_only') setVisible(false) } if (!mounted || !visible) return null return ( ) }