Download frontend/src/components/AgentTabs.jsx from bhuvi3/CIOAgent: direct link, hf CLI and curl.
- Browser
- Download file 1.29 kB
-
https://huggingface.co/spaces/bhuvi3/CIOAgent/resolve/main/frontend/src/components/AgentTabs.jsx
- Command line
-
hf download hf://spaces/bhuvi3/CIOAgent/frontend/src/components/AgentTabs.jsx
-
curl -L -o AgentTabs.jsx https://huggingface.co/spaces/bhuvi3/CIOAgent/resolve/main/frontend/src/components/AgentTabs.jsx
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> | |
| ); | |
| } | |