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.LoginName}
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 .
Get started by logging in to your Tailscale network. Or, learn more at{" "} tailscale.com .
You are connected! Access this device over Tailscale using the device name or IP address above.