client/web: add subnet routes view

Add UI view for mutating the node's advertised subnet routes.

Updates #10261

Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
This commit is contained in:
Sonia Appasamy
2023-11-27 20:23:41 -05:00
committed by Sonia Appasamy
parent 7aa981ba49
commit ecd1ccb917
11 changed files with 403 additions and 196 deletions
+33
View File
@@ -0,0 +1,33 @@
// Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause
import cx from "classnames"
import React, { ButtonHTMLAttributes } from "react"
type Props = {
intent?: "primary" | "secondary"
} & ButtonHTMLAttributes<HTMLButtonElement>
export default function Button(props: Props) {
const { intent = "primary", className, disabled, children, ...rest } = props
return (
<button
className={cx(
"px-3 py-2 rounded shadow justify-center items-center gap-2.5 inline-flex font-medium",
{
"bg-indigo-500 text-white": intent === "primary" && !disabled,
"bg-indigo-400 text-indigo-200": intent === "primary" && disabled,
"bg-stone-50 shadow border border-stone-200 text-neutral-800":
intent === "secondary",
"cursor-not-allowed": disabled,
},
className
)}
{...rest}
disabled={disabled}
>
{children}
</button>
)
}