"use client"; import { useState } from "react"; import ReactMarkdown from "react-markdown"; import remarkGfm from "remark-gfm"; interface ReportViewerProps { reports: Record; } const REPORT_TITLES: Record = { market_report: "Market Analysis", sentiment_report: "Social Sentiment", news_report: "News Analysis", fundamentals_report: "Fundamentals Analysis", trader_investment_plan: "Trading Team Plan", final_trade_decision: "Final Trade Decision", }; export default function ReportViewer({ reports }: ReportViewerProps) { const [expanded, setExpanded] = useState>({}); const toggleSection = (section: string) => { setExpanded((prev) => ({ ...prev, [section]: !prev[section], })); }; return (
{Object.entries(reports).map(([section, content]) => (
{expanded[section] && (
{content}
)}
))}
); }