Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
c15e4312a0
commit
41c3b7aa66
@@ -208,12 +208,12 @@ function ContactsIndex() {
|
||||
});
|
||||
};
|
||||
const toggleAllVisible = () => {
|
||||
const visibleIds = filtered.map((r) => r.id);
|
||||
const allSelected = visibleIds.every((id) => selected.has(id));
|
||||
const ids = visibleRows.map((r) => r.id);
|
||||
const allSelected = ids.every((id) => selected.has(id));
|
||||
setSelected((s) => {
|
||||
const next = new Set(s);
|
||||
if (allSelected) visibleIds.forEach((id) => next.delete(id));
|
||||
else visibleIds.forEach((id) => next.add(id));
|
||||
if (allSelected) ids.forEach((id) => next.delete(id));
|
||||
else ids.forEach((id) => next.add(id));
|
||||
return next;
|
||||
});
|
||||
};
|
||||
@@ -396,7 +396,7 @@ function ContactsIndex() {
|
||||
aria-label="Select all visible"
|
||||
/>
|
||||
<span className="text-xs text-muted-foreground">
|
||||
Select all {filtered.length} visible
|
||||
Showing {visibleRows.length} of {filtered.length}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user