fix(i18n): wrap CookieConsentRoot with LanguageProvider

The CookieConsentBanner uses useLanguage() hook but was rendered
outside of LanguageProvider in RootLayout. Added LanguageProvider
wrapper to fix the runtime error.
This commit is contained in:
Antigravity
2026-05-23 09:27:29 +00:00
parent a20cee0f63
commit 77f69fc1d1
19 changed files with 748 additions and 6 deletions

View File

@@ -5,8 +5,9 @@ import { useLanguage } from '@/lib/i18n'
import { updateAISettings } from '@/app/actions/ai-settings'
import { toast } from 'sonner'
import { useRouter } from 'next/navigation'
import { Globe, Bell } from 'lucide-react'
import { Globe, Bell, Shield } from 'lucide-react'
import { motion } from 'motion/react'
import { openCookiePreferences } from '@/lib/consent/cookie-consent'
interface GeneralSettingsClientProps {
@@ -174,6 +175,27 @@ export function GeneralSettingsClient({ initialSettings }: GeneralSettingsClient
</div>
</div>
</div>
<div className="bg-white/40 dark:bg-white/5 border border-border rounded-xl p-8 space-y-6">
<div className="flex items-center gap-5">
<div className="p-3 bg-paper dark:bg-white/10 rounded-2xl text-concrete border border-border">
<Shield size={18} />
</div>
<div className="space-y-0.5">
<h4 className="text-base font-bold text-ink">{t('consent.preferences.title')}</h4>
<p className="text-[11px] text-concrete">{t('consent.preferences.description')}</p>
</div>
</div>
<div className="pt-2">
<button
onClick={() => openCookiePreferences()}
className="w-full px-5 py-3.5 bg-white dark:bg-white/10 border border-border rounded-xl text-xs font-bold uppercase tracking-[0.25em] text-ink dark:text-paper hover:scale-[1.01] active:scale-95 transition-all duration-300 shadow-sm"
>
{t('consent.banner.manage')}
</button>
</div>
</div>
</div>
</motion.div>
)