fix: use project's useI18n hook instead of next-intl useTranslations
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m29s
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m29s
The project uses a custom i18n provider, not next-intl directly. This was causing a client-side crash on page load. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1,14 +1,14 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import { useTranslations } from "next-intl";
|
import { useI18n } from "@/lib/i18n";
|
||||||
import { motion, AnimatePresence } from "framer-motion";
|
import { motion, AnimatePresence } from "framer-motion";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
|
|
||||||
const STORAGE_KEY = "cookie-consent";
|
const STORAGE_KEY = "cookie-consent";
|
||||||
|
|
||||||
export function CookieConsent() {
|
export function CookieConsent() {
|
||||||
const t = useTranslations("cookieConsent");
|
const { t } = useI18n();
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -42,17 +42,17 @@ export function CookieConsent() {
|
|||||||
</span>
|
</span>
|
||||||
<div className="flex-1 min-w-0">
|
<div className="flex-1 min-w-0">
|
||||||
<h3 className="font-semibold text-foreground mb-1">
|
<h3 className="font-semibold text-foreground mb-1">
|
||||||
{t("title")}
|
{t("cookieConsent.title")}
|
||||||
</h3>
|
</h3>
|
||||||
<p className="text-sm text-muted-foreground leading-relaxed">
|
<p className="text-sm text-muted-foreground leading-relaxed">
|
||||||
{t("description")}
|
{t("cookieConsent.description")}
|
||||||
</p>
|
</p>
|
||||||
<div className="flex flex-wrap items-center gap-3 mt-4">
|
<div className="flex flex-wrap items-center gap-3 mt-4">
|
||||||
<Button variant="outline" size="sm" onClick={essentialOnly}>
|
<Button variant="outline" size="sm" onClick={essentialOnly}>
|
||||||
{t("essentialOnly")}
|
{t("cookieConsent.essentialOnly")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button size="sm" onClick={acceptAll}>
|
<Button size="sm" onClick={acceptAll}>
|
||||||
{t("acceptAll")}
|
{t("cookieConsent.acceptAll")}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user