onSelectConversation(conversation.id)}
+ >
+ {localLoading === conversation.id ? (
+
+ Looding...
+
+ //
+ ) : (
+
+ )}
+
+ {editingId === conversation.id ? (
+
setEditingTitle(e.target.value)}
+ onBlur={() => handleSaveEdit(conversation.id)}
+ onKeyDown={(e) => {
+ if (e.key === "Enter") {
+ handleSaveEdit(conversation.id)
+ } else if (e.key === "Escape") {
+ handleCancelEdit()
+ }
+ }}
+ className="flex-1 bg-transparent border-none outline-none text-sm"
+ autoFocus
+ onClick={(e) => e.stopPropagation()}
+ />
+ ) : (
+
+ {conversation.title}
+
+ )}
+
+ {editingId !== conversation.id && (
+
+
+
+
+
+ handleStartEdit(conversation)}>
+
+ 重命名
+
+ onDeleteConversation(conversation.id)}
+ className="text-destructive focus:text-destructive"
+ >
+
+ 删除
+
+
+
+ )}
+