feat: make footer badge dynamic from homepage content
This commit is contained in:
@@ -2,12 +2,17 @@
|
||||
|
||||
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">
|
||||
@@ -26,10 +31,12 @@ export default function Footer() {
|
||||
{t('footer.description')}
|
||||
</p>
|
||||
|
||||
<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>
|
||||
</div>
|
||||
{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">{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">
|
||||
|
||||
Reference in New Issue
Block a user