import { AnimatePresence, motion } from "framer-motion"; import { useGalleryStore } from "../store"; export function UpdateToast() { const updateStatus = useGalleryStore((s) => s.updateStatus); const updateVersion = useGalleryStore((s) => s.updateVersion); const updateProgress = useGalleryStore((s) => s.updateProgress); const updateDismissed = useGalleryStore((s) => s.updateDismissed); const installUpdate = useGalleryStore((s) => s.installUpdate); const dismissUpdate = useGalleryStore((s) => s.dismissUpdate); const visible = !updateDismissed && (updateStatus === "available" || updateStatus === "downloading" || updateStatus === "installing"); return ( {visible ? ( {updateStatus === "available" ? ( <>

Update available

Phokus v{updateVersion} is ready to download and install.

) : ( <>

{updateStatus === "installing" ? "Installing update..." : "Downloading update..."}

The app will restart when it finishes.

)} ) : null} ); }