fix: footer badge now properly hides when disabled in admin

This commit is contained in:
Erik
2025-11-29 13:23:24 -03:00
parent 0dd8f89fff
commit 4310a88b2a

View File

@@ -1,6 +1,7 @@
"use client";
import Link from 'next/link';
import { useEffect } from 'react';
import { useLocale } from '@/contexts/LocaleContext';
import { usePageContent } from '@/hooks/usePageContent';
@@ -12,7 +13,16 @@ export default function Footer() {
const prefix = locale === 'pt' ? '' : `/${locale}`;
// Badge do hero (dinâmica)
const badge = content?.hero?.badge || { text: 'Coca-Cola', show: true };
const badge = content?.hero?.badge || { text: 'Coca-Cola', show: false };
// Recarregar quando conteúdo mudar
useEffect(() => {
const handleRefresh = () => {
window.location.reload();
};
window.addEventListener('translation:refresh', handleRefresh);
return () => window.removeEventListener('translation:refresh', handleRefresh);
}, []);
return (
<footer className="bg-secondary text-white pt-16 pb-8">