// Copyright (c) Tailscale Inc & AUTHORS // SPDX-License-Identifier: BSD-3-Clause import cx from "classnames" import React, { useMemo } from "react" import { ReactComponent as ArrowRight } from "src/assets/icons/arrow-right.svg" import { ReactComponent as Machine } from "src/assets/icons/machine.svg" import AddressCard from "src/components/address-copy-card" import ExitNodeSelector from "src/components/exit-node-selector" import { NodeData, NodeUpdaters } from "src/hooks/node-data" import { pluralize } from "src/utils/util" import { Link, useLocation } from "wouter" export default function HomeView({ readonly, node, nodeUpdaters, }: { readonly: boolean node: NodeData nodeUpdaters: NodeUpdaters }) { const [allSubnetRoutes, pendingSubnetRoutes] = useMemo( () => [ node.AdvertisedRoutes?.length, node.AdvertisedRoutes?.filter((r) => !r.Approved).length, ], [node.AdvertisedRoutes] ) return (

This device

{node.DeviceName}

{node.Status === "Running" ? "Connected" : "Offline"}

{(node.Features["advertise-exit-node"] || node.Features["use-exit-node"]) && ( )} View device details →

Settings

{node.Features["advertise-routes"] && ( )} {node.Features["ssh"] && ( ), } : undefined } /> )} {/* TODO(sonia,will): hiding unimplemented settings pages until implemented */} {/* */}
) } function SettingsCard({ title, link, body, badge, footer, className, }: { title: string link: string body: string badge?: { text: string icon?: JSX.Element } footer?: string className?: string }) { const [, setLocation] = useLocation() return ( ) }