Open HnKnA opened 1 week ago
Hi @HnKnA, I’ve been reading through your implementation, and I think it's coming along well. I have a suggestion regarding the pagination controls that you might want to consider:
Currently, we have states and their handlers (e.g., itemsPerPage
with onItemsPerPageChange
, and goToPage
with onGoToPageChange
/onGoToPageSubmit
) that seem tightly coupled and are often used together. To ensure consistency and reduce the risk of mismatches, I suggest grouping related states and handlers into a single prop, such as a paginationControls
object. This would make it clear that these values should always be passed together.
For example:
paginationControls?: {
itemsPerPage: {
value; //this is the current itemsPerPage state,
onChange; //this is the current onItemsPerPageChange method,
},
goToPage: {
value; //goToPage,
onChange; //onGoToPageChange,
onSubmit; //onGoToPageSubmit,
}
}
Alternatively, if we need to keep itemsPerPage
and goToPage
separate, we could consider structuring them as distinct control props (itemsPerPageControl
and goToPageControl
). How do you think?
I prefer the approach of grouping related variables, and I will configure them today.
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Use 'Enter' click to submit the page change
https://github.com/user-attachments/assets/b8ad93a4-4fbe-4ea7-9f28-4e6a0dab1540