From 2b8bcd68c5b939aabef73f6d17279ba0e340336c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Tue, 6 Oct 2026 18:53:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E5=B8=83=E4=B8=BB=E8=A1=8C=E5=8A=A8?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=96=87=E6=A1=88=E6=94=B9=E7=94=A8=E7=BA=AF?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E9=80=89=E8=B7=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - GameDistributionPublishFormView 抽出 resolvePublishActionLabel(打包 / 上传 / 生成封面 / 上传截图 / 上传素材 / 常态),替换原来的五层嵌套三元 --- .../GameDistributionPublishFormView.tsx | 36 +++++++++++++------ 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/apps/ai-game-creator-shell/src/components/game-distribution/GameDistributionPublishFormView.tsx b/apps/ai-game-creator-shell/src/components/game-distribution/GameDistributionPublishFormView.tsx index 91d42eed8..2f0c5bcb3 100644 --- a/apps/ai-game-creator-shell/src/components/game-distribution/GameDistributionPublishFormView.tsx +++ b/apps/ai-game-creator-shell/src/components/game-distribution/GameDistributionPublishFormView.tsx @@ -22,6 +22,24 @@ function resolveMetadataHint(pending: boolean, ready: boolean) { return '已根据创作内容预填简介和分类,免费;你可以直接修改。'; } +/** + * 主行动按钮文案:打包 / 上传 / 生成封面 / 上传截图 / 上传素材 依次优先,都没有才是常态。 + */ +function resolvePublishActionLabel(state: { + packaging: boolean; + busy: boolean; + generatingCover: boolean; + screenshotsUploading: boolean; + uploadingLabel: string; +}) { + if (state.packaging) return '正在打包…'; + if (state.busy) return '上传中…'; + if (state.generatingCover) return '封面生成中…'; + if (state.screenshotsUploading) return '截图上传中…'; + if (state.uploadingLabel) return '素材上传中…'; + return '打包并发布'; +} + /** * 发布资料表单的表现层(工作台内联形态)。 * @@ -388,17 +406,13 @@ export function GameDistributionPublishFormView({ onClick={() => void handlePackageAndPublish()} className="inline-flex w-full items-center justify-center gap-2 rounded-xl border border-[#c7653d] bg-[#c7653d] px-6 py-4 text-lg font-bold tracking-wide text-white shadow-md transition enabled:hover:bg-[#b4562f] disabled:cursor-not-allowed disabled:opacity-45" > - {packaging - ? '正在打包…' - : busy - ? '上传中…' - : generatingCover - ? '封面生成中…' - : screenshotsUploading - ? '截图上传中…' - : uploadingLabel - ? '素材上传中…' - : '打包并发布'} + {resolvePublishActionLabel({ + packaging, + busy, + generatingCover, + screenshotsUploading, + uploadingLabel, + })} )}