删除 Direct 输入区发送按钮里不可达的忙态分支
- apps/ai-game-creator-shell/src/view/project-development/chat/components/DirectProjectComposer/DirectProjectComposer.tsx 发送按钮只在非 busy 分支渲染,去掉 '思考中' 文案、Loader2 转圈与 disabled 里的 busy 条件,并移除不再使用的 Loader2 import - busy 时仍由既有 ComposerStopButton 承担停止入口,渲染结果不变
This commit is contained in:
+6
-10
@@ -1,4 +1,4 @@
|
||||
import { ArrowUp, AtSign, Loader2 } from 'lucide-react';
|
||||
import { ArrowUp, AtSign } from 'lucide-react';
|
||||
import type { FormEventHandler } from 'react';
|
||||
import { useRef, useState } from 'react';
|
||||
|
||||
@@ -78,20 +78,16 @@ export function DirectProjectComposer({
|
||||
const [voiceNotice, setVoiceNotice] = useState('');
|
||||
const [modelReady, setModelReady] = useState(false);
|
||||
const [modelValidating, setModelValidating] = useState(false);
|
||||
const submitLabel = busy ? '思考中' : '发送';
|
||||
// 这个按钮只在非 busy 分支出现(busy 时由 ComposerStopButton 接管),所以不再带忙态逻辑。
|
||||
const submitButton = (
|
||||
<button
|
||||
type="submit"
|
||||
className="project-chat-submit-button"
|
||||
aria-label={submitLabel}
|
||||
title={submitLabel}
|
||||
disabled={busy || !modelReady || modelValidating}
|
||||
aria-label="发送"
|
||||
title="发送"
|
||||
disabled={!modelReady || modelValidating}
|
||||
>
|
||||
{busy ? (
|
||||
<Loader2 size={16} aria-hidden="true" className="animate-spin" />
|
||||
) : (
|
||||
<ArrowUp size={16} aria-hidden="true" />
|
||||
)}
|
||||
<ArrowUp size={16} aria-hidden="true" />
|
||||
</button>
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user