// Copyright (c) 2022 Tailscale Inc & AUTHORS All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. import { IPNState } from "./wasm_js" export function Header({ state, ipn }: { state: IPNState; ipn?: IPN }) { const stateText = STATE_LABELS[state] let logoutButton if (state === IPNState.Running) { logoutButton = ( ) } return (

Tailscale Connect

{stateText}
{logoutButton}
) } const STATE_LABELS = { [IPNState.NoState]: "Initializing…", [IPNState.InUseOtherUser]: "In-use by another user", [IPNState.NeedsLogin]: "Needs login", [IPNState.NeedsMachineAuth]: "Needs authorization", [IPNState.Stopped]: "Stopped", [IPNState.Starting]: "Starting…", [IPNState.Running]: "Running", } as const