feat: make footer badge dynamic from homepage content

This commit is contained in:
Erik
2025-11-29 13:03:45 -03:00
parent 278b9ade28
commit 6a7b84989b

View File

@@ -2,13 +2,18 @@
import Link from 'next/link';
import { useLocale } from '@/contexts/LocaleContext';
import { usePageContent } from '@/hooks/usePageContent';
export default function Footer() {
const { locale, t } = useLocale();
const { content } = usePageContent('home', locale);
// Prefixo para links
const prefix = locale === 'pt' ? '' : `/${locale}`;
// Badge do hero (dinâmica)
const badge = content?.hero?.badge || { text: 'Coca-Cola', show: true };
return (
<footer className="bg-secondary text-white pt-16 pb-8">
<div className="container mx-auto px-4">
@@ -26,10 +31,12 @@ export default function Footer() {
{t('footer.description')}
</p>
{badge?.show && (
<div className="inline-flex items-center gap-2 bg-white/5 border border-white/10 rounded-lg px-3 py-2 mb-6">
<i className="ri-verified-badge-fill text-primary"></i>
<span className="text-xs font-bold text-gray-300 uppercase tracking-wide">{t('home.officialProvider')} <span className="text-primary">Coca-Cola</span></span>
<span className="text-xs font-bold text-gray-300 uppercase tracking-wide">{t('home.officialProvider')} <span className="text-primary">{badge.text}</span></span>
</div>
)}
<div className="flex gap-4">
<a href="#" className="w-10 h-10 rounded-full bg-white/10 flex items-center justify-center hover:bg-primary transition-colors">