import { FormEvent } from 'react'; import { Search, ChevronRight, Clock, Star, Heart, Menu, User, BookOpen, ShieldCheck, CheckCircle2, Globe, Share2, Instagram } from 'lucide-react'; const DICT: Record = { pt: { back: 'Voltar ao Guia', exclusive: 'CONTEÚDO EXCLUSIVO', compare: 'COMPARAR CARTÕES', readTime: 'MIN', articles: [ { id: '1', title: 'Melhores Cartões de Crédito com Cashback em 2026', excerpt: 'Analisamos 15 cartões para descobrir qual deles realmente coloca dinheiro de volta no seu bolso em cada compra.', category: 'Cartões', time: '8', rating: '4.9', img: 'https://images.unsplash.com/photo-1556742111-a301076d9d18?auto=format&fit=crop&q=80&w=800' }, { id: '2', title: 'Como Sair do Vermelho: O Guia de 5 Passos', excerpt: 'Dicas práticas para renegociar dívidas e organizar seu orçamento mensal sem sofrimento.', category: 'Educação', time: '12', rating: '4.8', img: 'https://images.unsplash.com/photo-1554224155-6726b3ff858f?auto=format&fit=crop&q=80&w=800' }, { id: '3', title: 'Investindo em CDB: Vale a pena com a taxa SELIC atual?', excerpt: 'Entenda como a variação dos juros afeta seus rendimentos em renda fixa e quando diversificar.', category: 'Investimentos', time: '10', rating: '5.0', img: 'https://images.unsplash.com/photo-1460925895917-afdab827c52f?auto=format&fit=crop&q=80&w=800' } ] } }; export default function CardsTheme({ posts = [], activeView = 'home', currentArticle, children }: { posts?: any[], activeView?: 'home' | 'article', currentArticle?: any, children?: React.ReactNode }) { const lang = 'pt'; const ui = DICT[lang] || DICT['pt']; const articlesToRender = posts && posts.length > 0 ? posts.map((p, i) => ({ id: p.slug || p.id, category: p.category_name || 'FINANÇAS', title: p.title, excerpt: p.excerpt, time: '8', rating: '4.9', img: p.image || `https://images.unsplash.com/photo-1556742111-a301076d9d18?auto=format&fit=crop&q=80&w=800&random=${i}`, content: p.content, date: new Date(p.created_at || Date.now()).toLocaleDateString('pt-BR') })) : ui.articles; const displayArticle = currentArticle ? { ...currentArticle, id: currentArticle.slug || currentArticle.id, category: currentArticle.category_name || 'FINANÇAS', time: '8', rating: '4.9', img: currentArticle.image || `https://images.unsplash.com/photo-1556742111-a301076d9d18?auto=format&fit=crop&q=80&w=800` } : articlesToRender[0]; return (
{/* Header - Trust & Professional */}
SMARTWALLET
{activeView === 'home' ? (
{/* Featured Hero Box */}
Hero
{ui.exclusive}

{articlesToRender[0].title}

{articlesToRender[0].excerpt}

{articlesToRender[0].time} {ui.readTime}
{articlesToRender[0].rating}
{/* Info Grid */}
{articlesToRender.slice(1, 4).map((art: any, i: number) => (
{art.title}/
{art.category}

{art.title}

{art.time} {ui.readTime}
))}
{/* Trust Banner Ad */}
Parceiro Certificado SmartWallet

Proteja seu patrimônio digital.

Nossa tecnologia de criptografia militar garante que suas simulações de investimento nunca saiam do seu navegador.

) : ( /* --- ARTICLE VIEW --- */
← {ui.back}
{displayArticle.category}

{displayArticle.title}

Conteúdo Verificado
{displayArticle.time} {ui.readTime} {displayArticle.rating}
{children}
)} {/* Trust Footer */}
); }