+ {/* Space strip */}
+
+ {/* Home / DMs button */}
+
+
+
+
+ {/* Space icons */}
+ {spaces.map(space => {
+ const isSelected = space.id === selectedSpaceId;
+ const hasUnread = spaceHasUnread(space.id);
+ const iconUrl = space.icon
+ ? resolveAssetUrl(space.icon, space._instanceOrigin) ?? `/api/uploads/${space.icon}`
+ : null;
+ const grad = getSpaceGradient(space.id, space.name, space.avatarColor);
+
+ return (
+
+ {/* Unread / selected pill */}
+
+
+
+ );
+ })}
+
+
+
+ {/* Add space button */}
+
+
+
+ {/* Channel list */}
+
+ {/* Space header */}
+ {selectedSpace && (
+
+
+ {selectedSpace.name}
+
+ {canInvite && (
+
+ )}
+ {canManageSpace && (
+
+ )}
+
+ )}
+
+ {/* Channel list */}
+
+ {/* Uncategorized channels */}
+ {uncategorizedChannels.map(renderChannelItem)}
+
+ {/* Categorized channels */}
+ {sortedCategories.map(category => {
+ const catChannels = channelsByCategory.get(category.id) || [];
+ if (catChannels.length === 0) return null;
+ const isCollapsed = collapsedCategories.has(category.id);
+
+ return (
+
+
+ {!isCollapsed && catChannels.map(renderChannelItem)}
+
+ );
+ })}
+
+ {/* Empty state */}
+ {spaceChannels.length === 0 && selectedSpaceId && (
+
+ No channels yet
+
+ )}
+
+
+
+ {/* Add Space bottom sheet */}
+ {showAddSheet && (
+ <>
+
setShowAddSheet(false)} />
+
+
+
+
+
+
+
+
+ >
+ )}
+
+ );
+}