- {filteredContacts.map((contact) => {
- const name = displayName(contact)
- const selected = selectedContactIds.includes(contact.md5)
- const selectedByAll = exportAll && allContactTypes.includes(contact.type)
- const visuallySelected = exportAll ? selectedByAll : selected
- const atLimit =
- !exportAll && selectionMode && !selected && selectedContactIds.length >= selectionLimit
- return (
-
+ {virtualizeContacts ? (
+
+ {contactVirtualizer.getVirtualItems().map((virtualItem) => {
+ const contact = filteredContacts[virtualItem.index]
+ if (!contact) return null
+ const selected = selectedContactIds.includes(contact.md5)
+ const selectedByAll = exportAll && allContactTypes.includes(contact.type)
+ const visuallySelected = exportAll ? selectedByAll : selected
+ const atLimit =
+ !exportAll &&
+ selectionMode &&
+ !selected &&
+ selectedContactIds.length >= selectionLimit
+ return (
+
+ )
+ })}
+
+ ) : (
+ filteredContacts.map((contact) => {
+ const selected = selectedContactIds.includes(contact.md5)
+ const selectedByAll = exportAll && allContactTypes.includes(contact.type)
+ const visuallySelected = exportAll ? selectedByAll : selected
+ const atLimit =
+ !exportAll &&
+ selectionMode &&
+ !selected &&
+ selectedContactIds.length >= selectionLimit
+ return (
+
+ )
+ })
+ )}