import { NezhaAPISafe } from "@/app/types/nezha-api"; import ServerUsageBar from "@/components/ServerUsageBar"; import { Card } from "@/components/ui/card"; import { Popover, PopoverContent, PopoverTrigger, } from "@/components/ui/popover"; import { cn, formatNezhaInfo } from "@/lib/utils"; import ServerCardPopover from "./ServerCardPopover"; import getUnicodeFlagIcon from "country-flag-icons/unicode"; import MotionNumber from "motion-number"; export default function ServerCard({ serverInfo, }: { serverInfo: NezhaAPISafe; }) { const { name, country_code, online, cpu, up, down, mem, stg, ...props } = formatNezhaInfo(serverInfo); const showFlag = process.env.NEXT_PUBLIC_ShowFlag === "true"; return online ? (
{showFlag ? ( country_code ? ( {getUnicodeFlagIcon(country_code)} ) : ( 🏁 ) ) : null}

{name}

CPU

%

Mem

%

STG

%

Upload

Mb/s

Download

Mb/s
) : (
{showFlag ? ( country_code ? ( {getUnicodeFlagIcon(country_code)} ) : ( 🏁 ) ) : null}

{name}

Offline

); }