'use client' import { useState, useEffect } from 'react' import type { TrumpPost } from '@/types' import { getPosts } from '@/lib/api' import PostRow, { SignalPill, SourceIcon, fmtPct, timeAgo } from '@/components/dashboard/PostCards' function PostDetail({ post, onClose }: { post: TrumpPost; onClose: () => void }) { return (
Signal detail
@realDonaldTrump
{new Date(post.published_at).toLocaleString()}

{post.text}

{post.sentiment}
AI reasoning
{post.ai_reasoning || 'No reasoning available.'}
AI confidence {post.ai_confidence}%
{post.price_impact && (
Actual price impact · {post.price_impact.asset}
{(['m5', 'm15', 'm1h'] as const).map(k => { const v = post.price_impact![k] const correct = post.price_impact!['correct_' + k as 'correct_m5' | 'correct_m15' | 'correct_m1h'] const label = k === 'm5' ? '5m' : k === 'm15' ? '15m' : '1h' return (
{label}
= 0 ? 'up' : 'down'}`} style={{ fontSize: 15 }}>{fmtPct(v)}
{correct != null && (
{correct ? '✓ correct' : '✗ missed'}
)}
) })}
)}
) } export default function PostsPage() { const [posts, setPosts] = useState([]) const [loading, setLoading] = useState(true) const [filter, setFilter] = useState('all') const [selected, setSelected] = useState(null) useEffect(() => { getPosts(200, 1).then(setPosts).catch(() => {}).finally(() => setLoading(false)) }, []) const filtered = posts.filter(p => { if (filter !== 'all' && p.sentiment !== filter) return false return true }) const counts = { all: posts.length, bullish: posts.filter(p => p.sentiment === 'bullish').length, bearish: posts.filter(p => p.sentiment === 'bearish').length, neutral: posts.filter(p => p.sentiment === 'neutral').length, } const selectedPost = posts.find(p => p.id === selected) return (

Signals feed

Every post we tracked, every prediction we made. {posts.length} posts in the last 30 days.

Streaming
{(['all', 'bullish', 'bearish', 'neutral'] as const).map(f => ( ))}
{loading &&
Loading…
}
{filtered.map(p => ( setSelected(selected === p.id ? null : p.id)} /> ))}
{selected && selectedPost && setSelected(null)} />}
) }