import { FormEvent } from 'react'; import { Search, Menu, TrendingUp, TrendingDown, ChevronRight, Activity, Zap, Box, Hexagon, BarChart2, Globe, Share2, Instagram } from 'lucide-react'; const DICT: Record = { pt: { back: 'Voltar ao Tracker', live: 'DADOS AO VIVO', trending: 'EM ALTA', readTime: 'MIN', articles: [ { id: '1', title: 'Bitcoin Rompe Barreira dos $70k com ETF Spot', excerpt: 'Entrada massiva de capital institucional acelera a escassez on-chain antes do halving.', category: 'Bitcoin', time: '4', img: 'https://images.unsplash.com/photo-1518544801976-3e159e50e5bb?auto=format&fit=crop&q=80&w=800' }, { id: '2', title: 'Ethereum 2.0: O Impacto do Sharding na Escalabilidade', excerpt: 'Como a nova atualização promete reduzir as taxas de gas em até 90% para usuários finais.', category: 'Ethereum', time: '7', img: 'https://images.unsplash.com/photo-1622737133809-d95047b90223?auto=format&fit=crop&q=80&w=800' }, { id: '3', title: 'Regulação de Cripto na UE: O que Muda com a MiCA', excerpt: 'As novas diretrizes europeias que podem servir de modelo para o resto do mundo financeiro.', category: 'Regulação', time: '10', img: 'https://images.unsplash.com/photo-1639762681485-074b7f938ba0?auto=format&fit=crop&q=80&w=800' } ] } }; export default function CryptoTheme({ 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 || 'CRYPTO', title: p.title, excerpt: p.excerpt, time: '4', rating: '4.9', img: p.image || `https://images.unsplash.com/photo-1518544801976-3e159e50e5bb?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 || 'CRYPTO', time: '4', rating: '4.9', img: currentArticle.image || `https://images.unsplash.com/photo-1518544801976-3e159e50e5bb?auto=format&fit=crop&q=80&w=800` } : articlesToRender[0]; const COIN_DATA = [ { rank: 1, name: 'Bitcoin', symbol: 'BTC', price: '$68,432.12', h24: -1.2, d7: +5.4, cap: '$1,342B', vol: '$42B', color: '#F7931A' }, { rank: 2, name: 'Ethereum', symbol: 'ETH', price: '$3,842.50', h24: +2.1, d7: +1.2, cap: '$462B', vol: '$18B', color: '#627EEA' }, { rank: 3, name: 'Tether', symbol: 'USDT', price: '$1.00', h24: 0.0, d7: 0.0, cap: '$110B', vol: '$65B', color: '#26A17B' }, { rank: 4, name: 'Solana', symbol: 'SOL', price: '$145.22', h24: -4.5, d7: +12.8, cap: '$64B', vol: '$4.2B', color: '#14F195' }, { rank: 5, name: 'BNB', symbol: 'BNB', price: '$588.40', h24: +0.8, d7: -2.3, cap: '$88B', vol: '$1.2B', color: '#F3BA2F' }, ]; return (
{/* Crypto Header - Terminal Style */}
COINRADAR
Mercado Bitcoin Ethereum Swap Beta
{activeView === 'home' ? (
{/* Main Hero News Area */}
{ui.live}

{articlesToRender[0].title}

{articlesToRender[0].excerpt}

{[articlesToRender[1], articlesToRender[2]].map((art: any, i: number) => (
{art.title}/

{art.title}

{art.category} • {art.time} {ui.readTime}
))}
{/* Live Trending Sidebar */}

{ui.trending}

{COIN_DATA.map((coin) => (
{coin.symbol[0]}

{coin.name}

{coin.symbol}

{coin.price}
= 0 ? 'text-[#0ECB81]' : 'text-[#F6465D]'}`}> {coin.h24 >= 0 ? '+' : ''}{coin.h24}%
))}
{/* Sidebar Banner Ad */}

Cold Wallet Hub.

Proteja suas chaves privadas com a melhor custódia do mercado.

{/* Crypto Stats Table Row */}

Top Market Capitalization

{COIN_DATA.map((coin) => ( ))}
Rank Name Price 24h % Market Cap Volume (24h)
{coin.rank} {coin.name} {coin.symbol} {coin.price} = 0 ? 'text-[#0ECB81]' : 'text-[#F6465D]'}`}> {coin.h24 >= 0 ? '+' : ''}{coin.h24}% {coin.cap} {coin.vol}
) : ( /* --- ARTICLE VIEW --- */
← {ui.back}
{displayArticle.category}

{displayArticle.title}

{displayArticle.excerpt} Cobertura on-chain completa por especialistas do terminal Radar.

Breaking News
Live Feed {displayArticle.time} {ui.readTime}
{children}
)} {/* Crypto Terminal Footer */}
); }