"use client" import type { ReactNode } from "react" import Link from "next/link" import { Badge } from "@/components/reui/badge" import { IconTile } from "@/components/reui/icon-tile" import { StatusBadge } from "@/components/status-badge" import { Flag } from "@/components/flag" import type { InternetPathViewModel } from "@/lib/dashboard-internet-path" import type { ServerStatus } from "@/lib/data" import { cn } from "@/lib/utils" import { ArrowRightIcon, HomeIcon, RadioIcon, ServerIcon, GlobeIcon } from "lucide-react" function pathStateToServerStatus(state: InternetPathViewModel["pathState"]): ServerStatus { if (state === "healthy") return "online" if (state === "failover" || state === "degraded") return "degraded" return "offline" } function HopChip({ label, name, country, icon, iconClassName, }: { label: string name: string country?: string icon: ReactNode iconClassName?: string }) { return (
{label}
{country ?
Недостаточно данных для пути. Добавьте home-router и проверьте{" "} карту сети .
) } const hop = model.currentHop ?? model.primaryHop const wanName = hop?.wan.name ?? model.activeWanUplink?.name ?? "WAN" const wanIsp = hop?.wan.isp ?? model.activeWanUplink?.isp ?? "—" const ping = hop?.wanJhMetrics.pingMs const dl = hop?.wanJhMetrics.dlMbps return ({model.currentPath?.reason ?? model.primaryPath?.reason ?? "Текущий путь не определён"}