'use client' import { useState } from 'react' export function TradingReports() { const [generatedReport, setGeneratedReport] = useState(null) const [loading, setLoading] = useState(false) const [reportType, setReportType] = useState<'macro' | 'weekly' | 'trade'>('macro') const generateReport = async () => { setLoading(true) try { // Call our API to generate the report using MiniMax const response = await fetch('/api/ai/generate-report', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ type: reportType, date: new Date().toISOString().split('T')[0] }) }) const data = await response.json() if (data.report) { setGeneratedReport(data.report) } else { // Fallback sample if API not ready setGeneratedReport(getSampleReport()) } } catch (error) { console.error('Generation failed:', error) setGeneratedReport(getSampleReport()) } setLoading(false) } const getSampleReport = () => ` The Macroverse — Late Business Cycle Analysis

THE MACROVERSE

February 25, 2026

⚠️ ASSESSMENT: LATE BUSINESS CYCLE — RECESSION WINDOW: 2026-2028
S&P 500
6,909
Initial Claims
206K
Unemployment
4.1%
Fed Funds
4.5%
Bitcoin
$64,500

01 — Where We Are in the Cycle

Early Expansion
Mid Cycle
Late Cycle ◀️
Contraction

02 — Positioning

✅ ENERGY

Historically last to fall.

✅ CASH

Dry powder.

⏳ BITCOIN

Pricing weakness.

Generated by Thoth AI

` const downloadReport = () => { if (!generatedReport) return const blob = new Blob([generatedReport], { type: 'text/html' }) const url = URL.createObjectURL(blob) const a = document.createElement('a') a.href = url a.download = `thoth-report-${reportType}-${new Date().toISOString().split('T')[0]}.html` a.click() } return (

📈 Trading Reports

Generate AI-powered trading and macro reports. Thoth creates them using the LLM.

{/* Report Type Selection */}
{generatedReport && (

🤖 AI Generated Report

)}
) }