@snapdragonsnursery/react-components 1.1.33 → 1.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/ChildSearchPage.jsx +8 -4
package/package.json
CHANGED
package/src/ChildSearchPage.jsx
CHANGED
|
@@ -45,7 +45,8 @@ import {
|
|
|
45
45
|
import { cn } from "./lib/utils";
|
|
46
46
|
|
|
47
47
|
const ChildSearchPage = ({
|
|
48
|
-
title = "
|
|
48
|
+
title = "Child Search",
|
|
49
|
+
searchPlaceholder = "Search by name or child ID...",
|
|
49
50
|
siteId = null,
|
|
50
51
|
siteIds = null,
|
|
51
52
|
sites = null,
|
|
@@ -206,8 +207,11 @@ const ChildSearchPage = ({
|
|
|
206
207
|
getCoreRowModel: getCoreRowModel(),
|
|
207
208
|
getSortedRowModel: getSortedRowModel(),
|
|
208
209
|
state: {
|
|
209
|
-
rowSelection: selectedChildrenState.reduce((acc,
|
|
210
|
-
|
|
210
|
+
rowSelection: selectedChildrenState.reduce((acc, selectedChild) => {
|
|
211
|
+
const rowIndex = children.findIndex(child => child.child_id === selectedChild.child_id);
|
|
212
|
+
if (rowIndex !== -1) {
|
|
213
|
+
acc[rowIndex] = true;
|
|
214
|
+
}
|
|
211
215
|
return acc;
|
|
212
216
|
}, {}),
|
|
213
217
|
},
|
|
@@ -436,7 +440,7 @@ const ChildSearchPage = ({
|
|
|
436
440
|
<div className="relative mb-4">
|
|
437
441
|
<Input
|
|
438
442
|
type="text"
|
|
439
|
-
placeholder=
|
|
443
|
+
placeholder={searchPlaceholder}
|
|
440
444
|
value={searchTerm}
|
|
441
445
|
onChange={(e) => setSearchTerm(e.target.value)}
|
|
442
446
|
className="pl-4"
|