From 8d7ccc0d759a954b79859f8f7d7c73b47306c64f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Fri, 11 Sep 2026 18:51:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96=E5=B7=A5=E4=BD=9C=E6=B5=81?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E5=8D=A1=E7=8A=B6=E6=80=81=E6=98=A0=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 使用步骤映射替代嵌套三元表达式。 --- .../components/WorkflowActionCard.tsx | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/apps/ai-game-creator-shell/src/view/ui-editor/components/WorkflowActionCard.tsx b/apps/ai-game-creator-shell/src/view/ui-editor/components/WorkflowActionCard.tsx index f102006f2..7c392369b 100644 --- a/apps/ai-game-creator-shell/src/view/ui-editor/components/WorkflowActionCard.tsx +++ b/apps/ai-game-creator-shell/src/view/ui-editor/components/WorkflowActionCard.tsx @@ -12,18 +12,16 @@ export function WorkflowActionCard({ (workflow.activeStep === 'structure-recognition' && workflow.isRecognizing) || (workflow.activeStep === 'asset-separation' && workflow.isSeparating); - const status = - workflow.activeStep === 'reference-analysis' - ? workflow.suggestionStatus - : workflow.activeStep === 'structure-recognition' - ? workflow.recognitionStatus - : workflow.separationStatus; - const hasRun = - workflow.activeStep === 'reference-analysis' - ? workflow.hasSuggested - : workflow.activeStep === 'structure-recognition' - ? workflow.hasRecognized - : workflow.hasSeparated; + const status = { + 'reference-analysis': workflow.suggestionStatus, + 'structure-recognition': workflow.recognitionStatus, + 'asset-separation': workflow.separationStatus, + }[workflow.activeStep]; + const hasRun = { + 'reference-analysis': workflow.hasSuggested, + 'structure-recognition': workflow.hasRecognized, + 'asset-separation': workflow.hasSeparated, + }[workflow.activeStep]; return (