import { FormEvent } from 'react'; import { Settings, BarChart2, TrendingUp, TrendingDown, Clock, Crosshair, ChevronDown, ListFilter, PlayCircle, Minimize2, ExternalLink, Share2, Instagram, Globe } from 'lucide-react'; const DICT: Record = { pt: { back: 'Voltar ao Gráfico', signals: 'SINAIS AO VIVO', education: 'FORMAÇÃO TRADER', readTime: 'MIN', articles: [ { id: '1', title: 'Price Action: Rompimento de Suporte no Par EUR/USD', excerpt: 'Análise técnica detalhada sobre o comportamento do par após a divulgação dos dados de emprego.', category: 'Forex', time: '8', img: 'https://images.unsplash.com/photo-1611974789855-9c2a0a223690?auto=format&fit=crop&q=80&w=800' }, { id: '2', title: 'Psicologia do Trader: Como Lidar com o Drawdown', excerpt: 'Estratégias mentais para manter a disciplina operacional durante sequências de perdas inevitáveis.', category: 'Mindset', time: '15', img: 'https://images.unsplash.com/photo-1554224155-6726b3ff858f?auto=format&fit=crop&q=80&w=800' }, { id: '3', title: 'Guia de Indicadores: RSI vs MACD', excerpt: 'Entenda qual indicador de momentum se adapta melhor ao seu estilo de operacional (Scalp vs Swing).', category: 'Técnico', time: '10', img: 'https://images.unsplash.com/photo-1460925895917-afdab827c52f?auto=format&fit=crop&q=80&w=800' } ] } }; export default function TradingTheme({ 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 || 'SIGNAL', title: p.title, excerpt: p.excerpt, time: '8', rating: '4.9', img: p.image || `https://images.unsplash.com/photo-1611974789855-9c2a0a223690?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 || 'SIGNAL', time: '8', rating: '4.9', img: currentArticle.image || `https://images.unsplash.com/photo-1611974789855-9c2a0a223690?auto=format&fit=crop&q=80&w=800` } : articlesToRender[0]; return (
{/* Trading Header - Dark & Technical */}
PROTRADE
{activeView === 'home' ? (
{/* Main Chart/News Hero Area */}
{ui.signals}

{articlesToRender[0].title}

{articlesToRender[0].excerpt}

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

{art.title}

{art.category} {art.time} {ui.readTime}
))}
{/* Live Orderbook / Watchlist Sidebar */}

Watchlist

{[ { sym: 'EURUSD', price: '1.08420', chg: '+0.05%', color: '#089981' }, { sym: 'GBPUSD', price: '1.26540', chg: '-0.12%', color: '#F23645' }, { sym: 'USDJPY', price: '151.240', chg: '+0.34%', color: '#089981' }, { sym: 'XAUUSD', price: '2,175.40', chg: '-0.02%', color: '#F23645' }, { sym: 'US30', price: '39,475.0', chg: '+0.15%', color: '#089981' }, ].map((item) => (
{item.sym}
{item.price}
{item.chg}
))}
{/* Broker Affiliate Banner */}

Conta ECN Real.

Spreads a partir de 0.0 pips. Execução STP imediata.

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

{displayArticle.title}

Full Screen Analysis
{displayArticle.time} {ui.readTime} Ver no TradingView
{children}
)} {/* Trading Professional Footer */}
); }