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