Spaces:
Running on Zero
Running on Zero
deveshc23
feat: Add Free Gradio Space support, Git LFS tracking for data artifacts, and Quant Allocator
3e33e2e Download frontend/src/components/layout/Sidebar.tsx from deveshc23/drift-quant: direct link, hf CLI and curl.
- Browser
- Download file 2.79 kB
-
https://huggingface.co/spaces/deveshc23/drift-quant/resolve/main/frontend/src/components/layout/Sidebar.tsx
- Command line
-
hf download hf://spaces/deveshc23/drift-quant/frontend/src/components/layout/Sidebar.tsx
-
curl -L -o Sidebar.tsx https://huggingface.co/spaces/deveshc23/drift-quant/resolve/main/frontend/src/components/layout/Sidebar.tsx
2.79 kB
| import { BrandLogo } from "../common/BrandLogo"; | |
| export type NavigationPage = | |
| | "overview" | |
| | "market" | |
| | "strategies" | |
| | "results" | |
| | "compare" | |
| | "portfolio" | |
| | "trades" | |
| | "quality" | |
| | "reports" | |
| | "health"; | |
| interface SidebarProps { | |
| activePage: NavigationPage; | |
| onNavigate: (page: NavigationPage) => void; | |
| collapsed: boolean; | |
| onToggleCollapse: () => void; | |
| savedExperimentsCount?: number; | |
| } | |
| interface NavItem { | |
| id: NavigationPage; | |
| label: string; | |
| icon: string; | |
| badge?: string | number; | |
| } | |
| export function Sidebar({ | |
| activePage, | |
| onNavigate, | |
| collapsed, | |
| onToggleCollapse, | |
| savedExperimentsCount, | |
| }: SidebarProps) { | |
| const navItems: NavItem[] = [ | |
| { id: "overview", label: "Overview", icon: "π" }, | |
| { id: "market", label: "Market Explorer", icon: "π", badge: "488" }, | |
| { id: "strategies", label: "Strategy Lab", icon: "π§ͺ" }, | |
| { id: "results", label: "Backtest Results", icon: "π" }, | |
| { | |
| id: "compare", | |
| label: "Experiment Compare", | |
| icon: "βοΈ", | |
| badge: savedExperimentsCount, | |
| }, | |
| { id: "portfolio", label: "Portfolio Analytics", icon: "πΌ" }, | |
| { id: "trades", label: "Trade Explorer", icon: "π" }, | |
| { id: "quality", label: "Data Quality", icon: "π‘οΈ" }, | |
| { id: "reports", label: "Research Reports", icon: "π" }, | |
| { id: "health", label: "System Health", icon: "βοΈ" }, | |
| ]; | |
| return ( | |
| <aside className={`terminal-sidebar ${collapsed ? "collapsed" : ""}`}> | |
| <div className="sidebar-brand"> | |
| <div className="brand-icon"> | |
| <BrandLogo size={32} /> | |
| </div> | |
| {!collapsed && ( | |
| <div className="brand-text"> | |
| <strong>DRIFT QUANT</strong> | |
| <small>NSE RESEARCH LAB</small> | |
| </div> | |
| )} | |
| </div> | |
| <nav className="sidebar-nav"> | |
| {navItems.map((item) => ( | |
| <button | |
| key={item.id} | |
| type="button" | |
| className={`nav-item ${activePage === item.id ? "active" : ""}`} | |
| onClick={() => onNavigate(item.id)} | |
| title={collapsed ? item.label : undefined} | |
| > | |
| <span className="nav-icon">{item.icon}</span> | |
| {!collapsed && <span className="nav-label">{item.label}</span>} | |
| {!collapsed && item.badge !== undefined && ( | |
| <span className="nav-badge">{item.badge}</span> | |
| )} | |
| </button> | |
| ))} | |
| </nav> | |
| <div className="sidebar-footer"> | |
| <button | |
| type="button" | |
| className="collapse-toggle-btn" | |
| onClick={onToggleCollapse} | |
| title={collapsed ? "Expand navigation rail" : "Collapse navigation rail"} | |
| > | |
| {collapsed ? "βΆ" : "β Collapse"} | |
| </button> | |
| </div> | |
| </aside> | |
| ); | |
| } | |