"use client"; import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"; import { InfoIcon } from "lucide-react"; import { useSiteContext } from "@app/hooks/useSiteContext"; import { InfoSection, InfoSectionContent, InfoSections, InfoSectionTitle } from "@app/components/InfoSection"; import { useTranslations } from "next-intl"; import { useEnvContext } from "@app/hooks/useEnvContext"; type SiteInfoCardProps = {}; export default function SiteInfoCard({}: SiteInfoCardProps) { const { site, updateSite } = useSiteContext(); const t = useTranslations(); const { env } = useEnvContext(); const getConnectionTypeString = (type: string) => { if (type === "newt") { return "Newt"; } else if (type === "wireguard") { return "WireGuard"; } else if (type === "local") { return t("local"); } else { return t("unknown"); } }; return ( {(site.type == "newt" || site.type == "wireguard") && ( <> {t("status")} {site.online ? (
{t("online")}
) : (
{t("offline")}
)}
)} {t("connectionType")} {getConnectionTypeString(site.type)} {env.flags.enableClients && site.type == "newt" && ( Address {site.address?.split("/")[0]} )}
); }