feat: 按老师发布配置渲染快捷提示
This commit is contained in:
@@ -595,9 +595,15 @@ function ProjectTeacherChatPanel({
|
||||
<textarea ref={inputRef} aria-label={`向${label}提问`} value={text} disabled={busy} maxLength={6000} onChange={(e) => changeText(e.target.value)} placeholder="和老师聊聊" rows={2}
|
||||
onKeyDown={(e) => { if (e.key === 'Enter' && !e.shiftKey && !e.nativeEvent.isComposing) { e.preventDefault(); void send(); } }}
|
||||
className="min-h-[60px] w-full resize-none border-0 bg-transparent text-[13px] leading-6 outline-none placeholder:text-muted-foreground/65" />
|
||||
<div className="mt-2 flex min-h-11 items-center justify-between gap-2" data-testid="consultation-composer-actions">
|
||||
<div className="min-w-0 flex-1">
|
||||
{!draftRevision && !text.trim() && <button type="button" disabled={helpUnavailable} onClick={askForSuggestions} className="consultation-hint">继续看看👀</button>}
|
||||
<div className="mt-2 flex min-h-12 items-center justify-between gap-2" data-testid="consultation-composer-actions">
|
||||
<div className="flex max-h-48 min-w-0 flex-1 flex-wrap gap-2 overflow-y-auto pb-1">
|
||||
{!draftRevision && !text.trim() && (definition?.shortcuts == null
|
||||
? <button type="button" disabled={helpUnavailable} onClick={askForSuggestions} className="consultation-hint">继续看看👀</button>
|
||||
: definition.shortcuts.map((shortcut, index) => <button
|
||||
key={index} type="button" disabled={helpUnavailable}
|
||||
onClick={() => void send({ text: shortcut.prompt })}
|
||||
className="consultation-hint max-w-full whitespace-normal break-words text-left"
|
||||
>{shortcut.label}</button>))}
|
||||
</div>
|
||||
{running ? <button type="button" className="rounded-lg border px-3 py-2 text-xs" onClick={() => void teacherApi.cancel(topicBase, endpointId, running.id).then(consume).catch(() => setError('暂时无法停止,请稍后重试。'))}>停止回复</button>
|
||||
: <button type="submit" aria-label="提问" title={busy ? '正在发送…' : '发送'} disabled={busy || !topicEnabled || !text.trim()} className="consultation-send flex h-8 w-8 items-center justify-center rounded-full text-white disabled:opacity-30"><ArrowUp className="h-4 w-4" /></button>}
|
||||
|
||||
Reference in New Issue
Block a user