@@ -17,7 +17,10 @@ const _usd = new Intl.NumberFormat("en-US", {
17
17
export default function Page ( ) {
18
18
const data = useCachedLoaderData < LoaderData > ( ) ;
19
19
const [ params , setParams ] = useSearchParams ( ) ;
20
- const active_filters = Array . from ( params . entries ( ) ) . map ( ( [ k , v ] ) => (
20
+ const { sort, sort_direction, ...filters } = Object . fromEntries (
21
+ params . entries ( )
22
+ ) ;
23
+ const active_filters = Object . entries ( filters ) . map ( ( [ k , v ] ) => (
21
24
< div key = { k } className = "flex items-center gap-x-2" >
22
25
< button
23
26
type = "button"
@@ -54,7 +57,7 @@ export default function Page() {
54
57
) }
55
58
< p className = "font-bold my-2" > found: { data . num_items } </ p >
56
59
< div className = "overflow-x-auto relative" >
57
- < table className = "self-start border-collapse overflow-x-auto [&_th]:text-left [&_th]:align-top [&_th]:text-balance [&_td]:align-top [&_td,&_th]:p-2 [&_td,&_th]:border [&_td,&_th]:border-gray-l3" >
60
+ < table className = "self-start border-collapse overflow-x-auto [&_th]:text-left [&_th]:align-top [&_th]:text-balance [&_td]:text-nowrap [&_td,&_th]:p-2 [&_td,&_th]:border [&_td,&_th]:border-gray-l3" >
58
61
< thead >
59
62
< tr >
60
63
< th > EIN</ th >
@@ -219,6 +222,7 @@ export default function Page() {
219
222
< TextFilter
220
223
num = { 1 }
221
224
label = "NTEE code"
225
+ description = "can query partial e.g. A (starts with A) or complete (A80)"
222
226
_key = "ntee_code"
223
227
values = { ( k ) => params . get ( k ) ?. split ( "," ) || [ ] }
224
228
onChange = { ( vs , k ) => {
@@ -278,6 +282,7 @@ export default function Page() {
278
282
< TextFilter
279
283
num = { 4 }
280
284
label = "Classification code"
285
+ description = "NPOs may have up to 4 classification codes"
281
286
_key = "classification_code"
282
287
values = { ( k ) => params . get ( k ) ?. split ( "," ) || [ ] }
283
288
onChange = { ( vs , k ) => {
@@ -354,6 +359,7 @@ export default function Page() {
354
359
< TextFilter
355
360
num = { 3 }
356
361
label = "Activity code"
362
+ description = "NPOs may have up to 3 activity codes"
357
363
_key = "activity_code"
358
364
values = { ( k ) => params . get ( k ) ?. split ( "," ) || [ ] }
359
365
onChange = { ( vs , k ) => {
@@ -425,7 +431,26 @@ export default function Page() {
425
431
} }
426
432
/>
427
433
</ th >
428
- < th > Sort Name</ th >
434
+ < th >
435
+ < ListFilter
436
+ name = "Sort name"
437
+ _key = "sort_name"
438
+ filter = { {
439
+ values : ( k ) => params . get ( k ) ?. split ( "," ) || [ ] ,
440
+ optsFn : async ( ) => [ ] ,
441
+ onChange ( vs , k ) {
442
+ setParams ( ( p ) => {
443
+ if ( vs . length === 0 ) {
444
+ p . delete ( k ) ;
445
+ return p ;
446
+ }
447
+ p . set ( k , vs . join ( "," ) ) ;
448
+ return p ;
449
+ } ) ;
450
+ } ,
451
+ } }
452
+ />
453
+ </ th >
429
454
</ tr >
430
455
</ thead >
431
456
< tbody >
0 commit comments