import { getDashboardSummary, getRecentSignals, getRecentTrades } from '@/lib/queries'; import { RecentSignalsSection } from './RecentSignals'; import { Badge } from '@/components/ui/badge'; import { TradeTableClient } from '@/components/TradeTableClient'; function StatusIndicator({ running }: { running: boolean }) { return ( {running ? 'Running' : 'Stopped'} ); } function SummaryCard({ label, value, subtext, color = 'text-heading', }: { label: string; value: string; subtext?: string; color?: string; }) { return (

{label}

{value}

{subtext &&

{subtext}

}
); } export const dynamic = 'force-dynamic'; export default async function DashboardPage() { const [summary, recentSignals, recentTrades] = await Promise.all([ getDashboardSummary(), getRecentSignals(20), getRecentTrades(20), ]); return (

Dashboard

Weather arbitrage bot overview

{summary.dryRun && ( DRY RUN )}
{/* Bot Status Card */}

Bot Status

Uptime

{summary.uptime}

Mode

{summary.dryRun ? 'Dry Run' : 'Live'}

{/* Summary Cards */}
= 0 ? 'text-green-600 dark:text-green-400' : 'text-red-600 dark:text-red-400'} subtext="Unrealized + realized" />
{/* Recent Trades */} {recentTrades.length > 0 && (
)} {/* Recent Signals */}

Recent Signals

{recentSignals.length > 0 ? `Last ${recentSignals.length} signals` : 'No signals yet'}
{recentSignals.length > 0 ? ( ) : (

No signals yet. Start the bot to begin scanning markets.

)}
); }