import { ReactNode } from "react"; import { Browser } from "@wailsio/runtime"; import { Update as UpdateSvc } from "@bindings/services"; import { Button } from "@/components/Button"; import { useStatus } from "@/hooks/useStatus"; import { cn } from "@/lib/cn"; function openUrl(url: string) { void Browser.OpenURL(url).catch(() => window.open(url, "_blank")); } function formatLastChecked(date: Date) { return date.toLocaleString(undefined, { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit", }); } function triggerUpdate() { UpdateSvc.Trigger().catch(() => {}); } export function NetBirdVersionCard() { const { status } = useStatus(); const updateVersion = (status?.events ?? []) .map((e) => e.metadata?.["new_version_available"]) .find((v): v is string => Boolean(v)); if (updateVersion) { return (
Version {updateVersion} is available. What's new?
); } return (
Last checked on {formatLastChecked(new Date())} Changelog
); } function Card({ children, className }: { children: ReactNode; className?: string }) { return (
{children}
); } function Title({ children }: { children: ReactNode }) { return

{children}

; } function Link({ url, children }: { url: string; children: ReactNode }) { return ( ); }