One of the final things we need for the members page is the feature to search, sort, and paginate the data. I've implemented most of the UI and stuff on the Members page, we just need you to implement the logic that actually does the work. I've described the logic in the /util/searchSortPaginate.ts file, but here it is repeated:
1. use fuzzy search across all elements of each member
you can probably do this really easily by concatenating
the values into a string and then using indexOf
2. sort the elements that made it through
3. paginate by putting elements in arrays of length N (array.splice)
return an array of those paginated arrays
The reason we're returning an array of arrays is so we can just index them and get the different pages that way instead of having to do all the work to paginate/cache/manage the data from Supabase.
One of the final things we need for the members page is the feature to search, sort, and paginate the data. I've implemented most of the UI and stuff on the Members page, we just need you to implement the logic that actually does the work. I've described the logic in the
/util/searchSortPaginate.ts
file, but here it is repeated:The reason we're returning an array of arrays is so we can just index them and get the different pages that way instead of having to do all the work to paginate/cache/manage the data from Supabase.