{/* Brand Bar */}
{brandLogo}
{brandName}
{onToggleCollapse && (
)}
{/* Search Bar Toggle */}
{isSearching && (
setQuery(e.target.value)}
placeholder="Search chats…"
className="pl-8 pr-7 py-1.5 h-8 text-xs bg-zinc-50 dark:bg-zinc-900 border-zinc-200 dark:border-zinc-800 rounded-lg"
/>
{query && (
)}
)}
{/* New Chat Primary Button */}
{/* Quick Nav Links & More Popover */}
{navItems.map((item) => (
))}
{/* More Items Button */}
{/* More Nav Popover Menu */}
{showMoreNav && (
setShowMoreNav(false)}
>
{moreNavItems.map((mItem) => (
))}
)}
{/* ── MIDDLE SECTION: Scrollable Chat History ── */}
{filteredGroups.map((group) => (
{group.category}
{group.items.map((item) => {
const isActive = activeChat === item.id;
const isEditing = editingChatId === item.id;
const isMenuOpen = openMenuId === item.id;
if (isEditing) {
return (
setEditingTitle(e.target.value)}
onKeyDown={(e) => {
if (e.key === "Enter") handleSaveRename(item.id);
if (e.key === "Escape") setEditingChatId(null);
}}
className="h-7 text-xs px-2 py-0"
autoFocus
/>
);
}
return (
{/* Options Trigger Menu Button */}
{/* Extended Chat Action Popover Menu */}
{isMenuOpen && (
setOpenMenuId(null)}
>
{customChatActions && customChatActions.map((cAction) => (
))}
)}
);
})}
))}
{filteredGroups.length === 0 && (
No chats found for "{query}"
)}
{/* ── BOTTOM SECTION: User Profile & Upgrade Footer ── */}