import cx from "classnames" import React from "react" import { apiFetch } from "src/api" import { NodeData, NodeUpdate } from "src/hooks/node-data" // TODO(tailscale/corp#13775): legacy.tsx contains a set of components // that (crudely) implement the pre-2023 web client. These are implemented // purely to ease migration to the new React-based web client, and will // eventually be completely removed. export function Header({ data, refreshData, updateNode, }: { data: NodeData refreshData: () => void updateNode: (update: NodeUpdate) => void }) { return (
{data.Profile && data.Status !== "NoState" && data.Status !== "NeedsLogin" && ( <>

{data.Profile.LoginName}

{" "} |{" "} {" "} |{" "}
{data.Profile.ProfilePicURL ? (
) : (
)}
)}
) } export function IP(props: { data: NodeData }) { const { data } = props if (!data.IP) { return null } return ( <>

{data.DeviceName || "Your device"}

{data.IP}

Debug info: Tailscale {data.IPNVersion}, tun={data.TUNMode.toString()} {data.IsSynology && ( <> , DSM{data.DSMVersion} {data.TUNMode || ( <> {" "} ( outgoing access not configured ) )} )}

) } export function State({ data, updateNode, }: { data: NodeData updateNode: (update: NodeUpdate) => void }) { switch (data.Status) { case "NeedsLogin": case "NoState": if (data.IP) { return ( <>

Your device's key has expired. Reauthenticate this device by logging in again, or{" "} learn more .

) } else { return ( <>

Log in

Get started by logging in to your Tailscale network. Or, learn more at{" "} tailscale.com .

) } case "NeedsMachineAuth": return (
This device is authorized, but needs approval from a network admin before it can connect to the network.
) default: return ( <>

You are connected! Access this device over Tailscale using the device name or IP address above.

) } } export function Footer(props: { data: NodeData }) { const { data } = props return ( ) }