// Top-bar tab strip — IDE-style, multi-tab open/close/switch. const TabStrip = ({ tabs, activeTabId, onSelect, onClose }) => { return (
{tabs.map((t) => { const active = t.id === activeTabId; return ; })}
); }; const Tab = ({ tab, active, onSelect, onClose }) => { const [hover, setHover] = React.useState(false); return (
onSelect(tab.id)} onMouseEnter={() => setHover(true)} onMouseLeave={() => setHover(false)} style={{ position: "relative", display: "flex", alignItems: "center", gap: 6, height: "100%", padding: "0 12px", background: active ? "var(--bg-tab-active)" : hover ? "rgba(255,255,255,0.5)" : "transparent", borderTop: active ? "2px solid var(--accent)" : "2px solid transparent", borderLeft: "1px solid var(--border)", borderRight: "1px solid var(--border)", marginRight: -1, cursor: "pointer", fontSize: 12, color: active ? "var(--text)" : "var(--text-muted)", fontWeight: active ? 500 : 400, whiteSpace: "nowrap", }} > {tab.label} {tab.closable !== false ? ( { e.stopPropagation(); onClose(tab.id); }} style={{ display: "inline-flex", alignItems: "center", justifyContent: "center", width: 14, height: 14, color: "var(--text-faint)", borderRadius: 2, }} onMouseEnter={(e) => { e.currentTarget.style.background = "var(--danger)"; e.currentTarget.style.color = "#fff"; }} onMouseLeave={(e) => { e.currentTarget.style.background = "transparent"; e.currentTarget.style.color = "var(--text-faint)"; }} > ) : null}
); }; window.TabStrip = TabStrip;