CIOAgent / frontend /src /components /AgentTabs.jsx
bhuvighosh3
Deployment with restored Stress Specialist data
9fbb3f2
Raw History Blame Contribute Delete
1.29 kB
import React, { useState } from "react";
import ReactMarkdown from "react-markdown";
import remarkGfm from "remark-gfm";
const TABS = [
{ key: "performance", label: "Performance" },
{ key: "risk", label: "Risk" },
{ key: "benchmark", label: "Macro" },
{ key: "stress", label: "Stress" },
{ key: "allocation", label: "Allocation Strategy" },
{ key: "goal_planning", label: "Goal Planning" },
];
export default function AgentTabs({ inferences }) {
const [active, setActive] = useState("performance");
const visibleTabs = TABS.filter((t) => {
if (t.key === "allocation") return !!inferences.allocation;
if (t.key === "goal_planning") return !!inferences.goal_planning;
return true;
});
return (
<section className="section">
<h2>Multi-Agent Interpretations</h2>
<div className="tabs">
{visibleTabs.map((t) => (
<button
key={t.key}
className={`tab ${active === t.key ? "active" : ""}`}
onClick={() => setActive(t.key)}
>
{t.label}
</button>
))}
</div>
<div className="tab-content markdown-body">
<ReactMarkdown remarkPlugins={[remarkGfm]}>{inferences[active] || "No data."}</ReactMarkdown>
</div>
</section>
);
}