diff --git a/frontend/src/components/contacts/ContactList.tsx b/frontend/src/components/contacts/ContactList.tsx index 1fdafde..29c092e 100644 --- a/frontend/src/components/contacts/ContactList.tsx +++ b/frontend/src/components/contacts/ContactList.tsx @@ -475,10 +475,48 @@ export function ContactList({ ); + // Group header renderer for list view + const renderListGroupHeader = (group: GroupedContacts) => { + const isExpanded = expandedGroups.has(group.key); + return ( +
+ + {group.label} + ({group.contacts.length}) +
+ ); + }; + return (
- {shouldVirtualize ? ( + {isGrouped && groupedContacts ? ( +
+ {groupedContacts.map((group) => ( +
+ {renderListGroupHeader(group)} + {expandedGroups.has(group.key) && ( +
    + {group.contacts.map((contact) => renderContactItem(contact))} +
+ )} +
+ ))} +
+ ) : shouldVirtualize ? (
); + // Group header renderer for cards view + const renderCardsGroupHeader = (group: GroupedContacts) => { + const isExpanded = expandedGroups.has(group.key); + return ( +
+ + {group.label} + ({group.contacts.length}) +
+ ); + }; + return (
- {shouldVirtualize ? ( + {isGrouped && groupedContacts ? ( +
+ {groupedContacts.map((group) => ( +
+ {renderCardsGroupHeader(group)} + {expandedGroups.has(group.key) && ( +
+ {group.contacts.map((contact) => renderContactCard(contact))} +
+ )} +
+ ))} +
+ ) : shouldVirtualize ? (
{rowVirtualizer.getVirtualItems().map((virtualRow) => {