import { useAutoUpdater } from '../hooks/useAutoUpdater'; import { Button } from './ui/button'; import { Card } from './ui/card'; import { Progress } from './ui/progress'; export function UpdateNotification() { const { status, checkForUpdates, downloadAndInstall } = useAutoUpdater(true); if (status.error) { return null; } if (!status.available && !status.checking) { return null; } if (status.checking) { return ( Checking for updates... ); } if (status.available) { return ( Update Available Version {status.version} is ready to install {status.downloading && ( Downloading update... )} {status.installing && ( Installing update... App will restart automatically )} {!status.downloading && !status.installing && ( Install Now window.location.reload()} variant="outline" size="sm"> Later )} ); } return null; }
Version {status.version} is ready to install
Downloading update...
Installing update...
App will restart automatically