import { useState } from "react"; import { Button } from "@/components/Button"; import { useStatus } from "@/hooks/useStatus"; import { cn } from "@/lib/cn"; import { Update as UpdateSvc } from "@bindings/services"; // TODO: Shown only when management has auto updates enabled + there are updates available + force updates is disabled export const UpdateAvailableBanner = () => { const { status } = useStatus(); const [dismissed, setDismissed] = useState(false); if (import.meta.env.DEV) return null; const updateVersion = (status?.events ?? []) .map((e) => e.metadata?.["new_version_available"]) .find((v): v is string => Boolean(v)); if (!updateVersion || dismissed) return null; const triggerUpdate = () => { UpdateSvc.Trigger().catch(() => {}); }; return (
NetBird will update when you restart the app.