"use client"; import { Download, X } from "lucide-react"; import { useEffect, useState } from "react"; import { Button } from "@/components/ui/button"; import { cn } from "@/lib/utils"; type UpdatePromptState = { version: string; }; export function DesktopUpdatePrompt() { const [update, setUpdate] = useState(null); useEffect(() => { const api = window.electronAPI; if (!api?.onUpdateDownloaded) return; return api.onUpdateDownloaded(({ version }) => { setUpdate({ version }); }); }, []); if (!update) return null; const installAndRestart = () => { void window.electronAPI?.installUpdateNow(); }; return (
Update available

A new version of SurfSense ({update.version}) is now available to install.

); }