把澄清问答卡提交按钮文案的嵌套三元改成顺序分支
- apps/ai-game-creator-shell/src/view/project-development/planning/PlanningUserInputCard.tsx 把 answerPrepared / controlBusy||submitting 的嵌套三元改成先取默认值再覆盖的 submitLabel - 文案取值不变
This commit is contained in:
+7
-5
@@ -26,6 +26,12 @@ export function PlanningUserInputCard({
|
||||
Boolean(answers[question.id]?.trim()),
|
||||
);
|
||||
const disabled = controlBusy || submitting || answerPrepared;
|
||||
let submitLabel = '提交回答';
|
||||
if (answerPrepared) {
|
||||
submitLabel = '回答已提交';
|
||||
} else if (controlBusy || submitting) {
|
||||
submitLabel = '提交中';
|
||||
}
|
||||
|
||||
return (
|
||||
<section className="agent-runtime-user-input" aria-label="Needs input">
|
||||
@@ -93,11 +99,7 @@ export function PlanningUserInputCard({
|
||||
).finally(() => setSubmitting(false));
|
||||
}}
|
||||
>
|
||||
{answerPrepared
|
||||
? '回答已提交'
|
||||
: controlBusy || submitting
|
||||
? '提交中'
|
||||
: '提交回答'}
|
||||
{submitLabel}
|
||||
</button>
|
||||
</section>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user