Files
Netcatty/components/vault/MonitorNavButton.tsx
T
陈大猫 c2c4b6ec77 Refine monitoring layout and shared host-picker styling (#3705)
* refine(monitor): compact panel controls into the Vault header

* refine(monitor): simplify navigation and match Vault visuals

* refine(vault): remove active host selection outlines

* refine(monitor): keep default cursor until dragging

* fix(monitor): label network directions for screen readers
2026-10-17 19:46:35 +08:00

39 lines
1.1 KiB
TypeScript

import React from "react";
import { Gauge } from "lucide-react";
import { useI18n } from "../../application/i18n/I18nProvider";
import { cn } from "../../lib/utils";
import { RippleButton } from "../ui/ripple";
import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip";
export function MonitorNavButton({
active,
collapsed,
onClick,
}: {
active: boolean;
collapsed: boolean;
onClick: () => void;
}) {
const { t } = useI18n();
return (
<Tooltip>
<TooltipTrigger asChild>
<RippleButton
variant={active ? "secondary" : "ghost"}
onClick={onClick}
aria-label={t("monitor.title")}
className={cn(
"w-full h-10",
collapsed ? "justify-center p-0" : "justify-start gap-3",
active &&
"bg-foreground/10 text-foreground hover:bg-foreground/15 border-border/40",
)}
>
<Gauge size={16} className="shrink-0" />
{!collapsed && <span>{t("monitor.title")}</span>}
</RippleButton>
</TooltipTrigger>
<TooltipContent side="right">{t("monitor.title")}</TooltipContent>
</Tooltip>
);
}