简化工作流操作卡状态映射

使用步骤映射替代嵌套三元表达式。
This commit is contained in:
2026-09-11 18:51:30 +08:00
parent 2af3d9a965
commit 8d7ccc0d75
@@ -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 (
<section className="shrink-0 border-b border-(--platform-subpanel-border) bg-(--platform-subpanel-fill) px-4 py-3">