import React from 'react'; import { Search, Terminal } from 'lucide-react'; import { usePortalStore } from '../store/usePortalStore'; import type { RouteModeId, ThemeId } from '../types/telemetry'; const THEMES: Array<{ id: ThemeId; label: string; dot: string }> = [ { id: 'zinc-dark', label: '深色极客', dot: '#18181b' }, { id: 'zinc-light', label: '浅色纯净', dot: '#f8fafc' }, { id: 'catppuccin', label: 'Catppuccin', dot: '#cba6f7' }, { id: 'nord', label: 'Nord', dot: '#88c0d0' }, ]; const MODES: Array<{ id: RouteModeId; label: string }> = [ { id: 'auto', label: '智能路由' }, { id: 'edge443', label: '443 免端口' }, { id: 'home10443', label: '10443 家宽' }, { id: 'lan', label: 'LAN 局域网' }, ]; export const TopRibbon: React.FC = () => { const { theme, routeMode, telemetry, setTheme, setRouteMode, setShowAgyModal, setShowCmdPalette, } = usePortalStore(); return (
{/* Left: Brand + Live System Micro-Gauges Ribbon */}
Mac mini HomeLab
{/* CPU Gauge */}
M6 CPU
{telemetry.mini.cpu_pct}%
{/* RAM Gauge */}
RAM
{telemetry.mini.mem_used_gb}G
{/* ZSpace 20TB Gauge */}
NAS 余量
{telemetry.nas.free_tb} TB
{/* SG AI Line Gauge */}
SG 专线 {telemetry.network.sg_delay_ms > 0 ? `${telemetry.network.sg_delay_ms}ms` : '直连'}
{/* Right: Search (Cmd+K), Route Switcher, Theme Switcher, Terminal Button */}
{MODES.map((m) => ( ))}
{THEMES.map((t) => ( ))}
); };