import { Check, Network, Plus } from 'lucide-react'; import { Link } from 'react-router'; import { headscaleSectionPath } from './shared'; import { useHeadscaleServers } from './useHeadscaleServers'; // Top-left panel of the /headscale workspace: which server everything else acts on. // // It is its own panel rather than a block inside HeadscaleNav because the two answer different questions — // "which server" and "which section" — and only one of them is navigation. Activating a server is a mutation // (a DB write that re-scopes every other query), so these stay buttons with no URL of their own, while the // section list below is real links. // // Every registered server is listed, including when there is only one: the panel's whole job is to say what // the rest of the screen is talking to, and a picker that hides itself at one server makes that invisible. export const HeadscaleServerPicker = () => { const { servers, active, activate, isLoading } = useHeadscaleServers(); return (
Headscale
{active ? active.name : 'no server'}
{servers.map((server) => ( ))} {servers.length === 0 && !isLoading && ( Register a server )}
); };