"use client"; import { FaDownload, FaTimes } from "react-icons/fa"; import { LuRefreshCw } from "react-icons/lu"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; interface AppUpdateInfo { current_version: string; new_version: string; release_notes: string; download_url: string; is_nightly: boolean; published_at: string; } interface AppUpdateToastProps { updateInfo: AppUpdateInfo; onUpdate: (updateInfo: AppUpdateInfo) => Promise; onDismiss: () => void; isUpdating?: boolean; updateProgress?: string; } export function AppUpdateToast({ updateInfo, onUpdate, onDismiss, isUpdating = false, updateProgress, }: AppUpdateToastProps) { const handleUpdateClick = async () => { await onUpdate(updateInfo); }; return (
{isUpdating ? ( ) : ( )}
Donut Browser Update Available {updateInfo.is_nightly ? "Nightly" : "Stable"}
Update from {updateInfo.current_version} to{" "} {updateInfo.new_version}
{!isUpdating && ( )}
{isUpdating && updateProgress && (

{updateProgress}

)} {!isUpdating && (
)}
); }