94 lines
2.3 KiB
JavaScript
94 lines
2.3 KiB
JavaScript
"use client";
|
||
|
||
import Link from "next/link";
|
||
import {
|
||
CookieConsent,
|
||
openPreferences,
|
||
} from "@pdntechnology/cookie-consent/react";
|
||
|
||
const labels = {
|
||
title: "Çerez tercihleri",
|
||
message: "Deneyiminizi iyileştirmek ve site trafiğini analiz etmek için çerez kullanıyoruz.",
|
||
policyLink: "Çerez politikası",
|
||
accept: "Tümünü kabul et",
|
||
reject: "Tümünü reddet",
|
||
manage: "Tercihleri yönet",
|
||
save: "Tercihleri kaydet",
|
||
necessaryTitle: "Zorunlu",
|
||
necessaryDescription: "Sitenin temel işlevleri için gereklidir. Her zaman aktiftir.",
|
||
analyticsTitle: "Analitik",
|
||
analyticsDescription: "Google Analytics (_ga, _gid) ile ziyaretçi trafiğini ölçer.",
|
||
marketingTitle: "Pazarlama",
|
||
marketingDescription: "Google Ads ve Meta Pixel ile reklam performansını ölçer.",
|
||
alwaysOn: "Her zaman açık",
|
||
cookiesHeading: "Kullanılan çerezleri gör",
|
||
cookieName: "Ad",
|
||
cookiePurpose: "Amaç",
|
||
cookieDuration: "Süre",
|
||
cookieProvider: "Sağlayıcı",
|
||
storageError: "Tercihleriniz kaydedilemedi. Lütfen tekrar deneyin.",
|
||
};
|
||
|
||
const cookies = [
|
||
{
|
||
category: "necessary",
|
||
name: "demo_cookie_consent",
|
||
purpose: "Çerez tercihlerinizi saklar",
|
||
duration: "1 yıl",
|
||
provider: "Bu site",
|
||
},
|
||
{
|
||
category: "analytics",
|
||
name: "_ga",
|
||
purpose: "Ziyaretçi istatistikleri",
|
||
duration: "2 yıl",
|
||
provider: "Google Analytics",
|
||
},
|
||
{
|
||
category: "analytics",
|
||
name: "_gid",
|
||
purpose: "Oturum ayırma",
|
||
duration: "24 saat",
|
||
provider: "Google Analytics",
|
||
},
|
||
{
|
||
category: "marketing",
|
||
name: "_fbp",
|
||
purpose: "Reklam hedefleme",
|
||
duration: "3 ay",
|
||
provider: "Meta",
|
||
},
|
||
];
|
||
|
||
export function Providers({ children }) {
|
||
return (
|
||
<>
|
||
{children}
|
||
<CookieConsent
|
||
policyHref="/cerez-politikasi"
|
||
LinkComponent={Link}
|
||
labels={labels}
|
||
cookies={cookies}
|
||
theme={{
|
||
primary: "#2563eb",
|
||
background: "rgba(15, 23, 42, 0.97)",
|
||
text: "#f8fafc",
|
||
link: "#93c5fd",
|
||
accent: "#2563eb",
|
||
}}
|
||
onConsentError={({ reason }) => {
|
||
console.warn("[demo] consent error:", reason);
|
||
}}
|
||
/>
|
||
</>
|
||
);
|
||
}
|
||
|
||
export function CookieSettingsButton() {
|
||
return (
|
||
<button type="button" onClick={openPreferences}>
|
||
Çerez ayarları
|
||
</button>
|
||
);
|
||
}
|