+ {React.createElement(MessageCircle, {
+ className: "h-4 w-4 flex-shrink-0 text-gray-400",
+ })}
+ {!isCollapsed && (
+ <>
+ {editingChatId === chat.id ? (
+
setEditingTitle(e.target.value)}
+ onKeyDown={handleKeyDown}
+ className="flex-1 bg-transparent text-sm text-white focus:outline-none"
+ autoFocus
+ />
+ ) : (
+
{
+ if (chat.id) onSelectChat?.(chat.id);
+ }}
+ className="flex-1 truncate text-left text-sm text-gray-300"
+ >
+ {chat.title}
+
+ )}
+
+ handleEditStart(chat)}
+ className="rounded p-1 text-gray-500 hover:text-gray-300"
+ >
+ {React.createElement(Pencil, { className: "h-3.5 w-3.5" })}
+
+ {
+ if (chat.id) onDeleteChat?.(chat.id);
+ }}
+ className="rounded p-1 text-gray-500 hover:text-gray-300"
+ >
+ {React.createElement(Trash2, { className: "h-3.5 w-3.5" })}
+
+
+ >
+ )}
+
+ ))}
+ >
+);
+
+export function ChatSidebar({
+ chats = [],
+ currentChatId,
+ onSelectChat,
+ onDeleteChat,
+ onUpdateChatTitle,
+ fastMode = false,
+ onToggleFastMode,
+ className,
+ isCollapsed = false,
+ style,
+}: ChatSidebarProps) {
+ const [editingChatId, setEditingChatId] = React.useState