'use client'; import { useRef } from 'react'; import { motion, useInView } from 'framer-motion'; import { useTranslations } from 'next-intl'; import { Cookie, Settings, BarChart3, Target, Shield, ToggleLeft, Mail, type LucideIcon } from 'lucide-react'; import { LandingHeader, LandingFooter } from '@/components/layout'; type CookieTypeKey = 'essential' | 'analytics' | 'marketing' | 'functional'; interface CookieRow { name: string; purposeKey: string; durationKey: string; } interface CookieTypeConfig { key: CookieTypeKey; icon: LucideIcon; required: boolean; cookies: CookieRow[]; } const COOKIE_TYPES: CookieTypeConfig[] = [ { key: 'essential', icon: Shield, required: true, cookies: [ { name: 'session_id', purposeKey: 'session_id', durationKey: 'session' }, { name: 'csrf_token', purposeKey: 'csrf_token', durationKey: 'session' }, { name: 'cookie_consent', purposeKey: 'cookie_consent', durationKey: 'year1' }, ], }, { key: 'analytics', icon: BarChart3, required: false, cookies: [ { name: '_ga', purposeKey: '_ga', durationKey: 'years2' }, { name: '_gid', purposeKey: '_gid', durationKey: 'hours24' }, { name: '_gat', purposeKey: '_gat', durationKey: 'minute1' }, ], }, { key: 'marketing', icon: Target, required: false, cookies: [ { name: '_fbp', purposeKey: '_fbp', durationKey: 'months3' }, { name: 'li_fat_id', purposeKey: 'li_fat_id', durationKey: 'days30' }, { name: 'hubspotutk', purposeKey: 'hubspotutk', durationKey: 'months13' }, ], }, { key: 'functional', icon: Settings, required: false, cookies: [ { name: 'language', purposeKey: 'language', durationKey: 'year1' }, { name: 'theme', purposeKey: 'theme', durationKey: 'year1' }, { name: 'recent_searches', purposeKey: 'recent_searches', durationKey: 'days30' }, ], }, ]; export default function CookiesPage() { const t = useTranslations('marketing.cookies'); const tCommon = useTranslations('marketing.common'); const heroRef = useRef(null); const contentRef = useRef(null); const isHeroInView = useInView(heroRef, { once: true }); const isContentInView = useInView(contentRef, { once: true }); const containerVariants = { hidden: { opacity: 0, y: 50 }, visible: { opacity: 1, y: 0, transition: { duration: 0.6, staggerChildren: 0.1, }, }, }; const itemVariants = { hidden: { opacity: 0, y: 20 }, visible: { opacity: 1, y: 0, transition: { duration: 0.5 }, }, }; return (
{t('intro')}
{tCommon('lastUpdated')}
{t('introBoxBody1')}
{t('introBoxBody2')}
{t('typesSubtitle')}
{t(`types.${type.key}.description`)}
| {t('tableHeaders.name')} | {t('tableHeaders.purpose')} | {t('tableHeaders.duration')} |
|---|---|---|
| {cookie.name} | {t(`purposes.${cookie.purposeKey}` as any)} | {t(`durations.${cookie.durationKey}` as any)} |
{t('manageIntro')}
{t('manageNote')}
{t('contact.body')}