import { Badge } from "@/components/ui/badge" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { AlertTriangle, CheckCircle, Activity, ArrowUpRight } from "lucide-react" async function getData() { // In a real app, this would be an API call or DB query // For the prototype, we load the JSON generated by the python engine // Simulating fetch delay await new Promise(resolve => setTimeout(resolve, 100)) // Use environment variable with localhost fallback for development const apiUrl = process.env.LATENT_API_URL || 'http://localhost:3000' const res = await fetch(`${apiUrl}/data.json`, { cache: 'no-store' }) if (!res.ok) throw new Error('Failed to fetch data') return res.json() } export default async function Dashboard() { const signals = await getData() return (
{/* Header */}

LATENT v1.0

Epistemic Divergence Monitor // Pharma Sector

Status
LIVE MONITORING
{/* Main Content */}
{/* Left Col: High Level Stats */}
Active Molecules
3

Semaglutide, Tirzepatide, Liraglutide

Social Volume
8,492

Posts analyzed (Last 30d)

Alpha Signal Detected

Semaglutide shows a 0.88 divergence on "Gastroparesis". Signal is absent from FDA label but high volume in Tier 5 sources.

{/* Right Col: The Heatmap */}

Signal Divergence Feed

{signals.map((signal: any, idx: number) => (

{signal.molecule}

// {signal.signal}
{signal.status.replace('_', ' ')} Vol: {signal.volume}
Divergence Score
{signal.divergence_score.toFixed(2)}
{/* Progress Bar Visual */}
FDA Status {signal.regulatory_status}
Social Trend Rising (+12%)
))}
) } function getScoreColor(score: number) { if (score > 0.7) return "text-red-500" if (score > 0.4) return "text-amber-500" return "text-emerald-500" } function getBarColor(score: number) { if (score > 0.7) return "bg-red-500" if (score > 0.4) return "bg-amber-500" return "bg-emerald-500" }