A custom React hook that manages filtering, searching, pagination, and sorting.
Prop | Type | Description |
---|---|---|
filter | Object | Contains the current filter state. |
setSort | Function | Updates the sorting criteria. Parameter: sort (string) - The sorting key. |
setDate | Function | Sets the start and end date filters. Parameters: start (string | Date) - Start date, end (string | Date) - End date. |
setPage | Function | Updates the page number. Parameter: page (number) - The new page number. |
setSearch | Function | Updates the search keyword. Parameter: search (string) - The search term. |
setReset | Function | Resets the filter to the initial values. |
setFilter | Function | Replaces the filter state with a new object. Parameter: newFilter (Object) - The new filter state. |