/** * ComputeSettingsTabs — segmented navigation for the Compute section. * * Splits the feature into the three concerns the design separates — inventory * (Resources), connections (Sources), and policy (Routing) — instead of one * long scroll. "Connect source" on the Resources tab deep-links to Sources. */ import React, { useState } from "react"; import { Cpu, Server, SlidersHorizontal } from "lucide-react"; import ComputeResourcesPanel from "./ComputeResourcesPanel"; import ComputeSourcesSettings from "./ComputeSourcesSettings"; import RoutingPolicyEditor from "./RoutingPolicyEditor"; type Tab = "resources" | "sources" | "routing"; const TABS: { id: Tab; label: string; Icon: typeof Cpu }[] = [ { id: "resources", label: "Resources", Icon: Cpu }, { id: "sources", label: "Sources", Icon: Server }, { id: "routing", label: "Routing", Icon: SlidersHorizontal }, ]; export default function ComputeSettingsTabs() { const [tab, setTab] = useState("resources"); return (
{TABS.map(({ id, label, Icon }) => ( ))}
{tab === "resources" && setTab("sources")} />} {tab === "sources" && } {tab === "routing" && }
); }