+ {/* ---- 状态展示 ---- */}
+ {status === 'idle' && (
+
+ 点击下方按钮检查是否有新版本
+
+ )}
+
+ {status === 'checking' && (
+
+
+ 正在检查更新...
+
+ )}
+
+ {status === 'no-update' && (
+
+
+ 已是最新版本
+
+ )}
+
+ {status === 'error' && (
+
+
+ {error?.message || '检查更新失败'}
+
+ )}
+
+ {/* ---- 发现新版本 / 下载中 ---- */}
+ {(status === 'available' || status === 'downloading') && (
+ <>
+
+
+ 发现新版本:{info?.version}
+ {info?.forceUpdate && 强制更新}
+
+ {info?.releaseNotes && (
+
+ {info.releaseNotes}
+
+ )}
+ >
+ )}
+
+ {/* ---- 下载进度 ---- */}
+ {status === 'downloading' && (
+
+ )}
+
+ {/* ---- 下载完成 ---- */}
+ {status === 'downloaded' && (
+ <>
+
+
+ 更新已下载完毕,点击安装并重启
+
+
}
+ onClick={installUpdate}
+ size="small"
+ className="self-start"
+ >
+ 安装更新
+
+ >
+ )}
+
+ {/* ---- 操作按钮 ---- */}
+
+ }
+ onClick={checkForUpdates}
+ disabled={status === 'checking'}
+ >
+ 检查更新
+
+ {isDev() && (
+
+ 生产环境启动 5 秒后自动检查
+
+ )}
+
+
+