- {/* 附件标签 - 显示在输入框内部顶部 */}
- {attachments.length > 0 && (
-
- {attachments.map((att, index) => (
-
textareaRef.current?.focus()}
+ >
+ {/* 附件标签 */}
+ {attachments.map((att, index) => (
+
+ {/* 小缩略图 */}
+

+ {/* 图片名称 */}
+
+ {att.name || 'Image'}
+
+ {/* 删除按钮 */}
+
- ))}
-
- )}
+
+
+
+ ))}
+
+ {/* 文本输入 - 自适应宽度 */}
+
setInput(e.target.value)}
+ onKeyDown={(e) => {
+ if (e.key === 'Enter' && !e.shiftKey) {
+ e.preventDefault();
+ handleSend();
+ }
+ }}
+ placeholder={attachments.length > 0 ? "添加描述..." : "请输入你的设计需求"}
+ className="flex-1 min-w-[120px] text-sm bg-transparent border-none outline-none placeholder:text-muted-foreground/50"
+ disabled={isLoading}
+ />
+