I wrote a super simple search function for the employees table. It's a little slow which stack overflow leads me to believe is a result of updating search results on each keystroke rather than having a "search" button or something like that. I'm willing to sacrifice a little performance to leave it as it is. Update per keystroke is how I like my search bars but if your opinion differs we can change it. Might be able to improve performance a bit with a better search algorithm idk.
I had chatGPT figure out the sort logic for the entries table. It's a lot better than what I came up with. My machine overlord's apt use of the useMemo hook prompted me to learn more about memoization in general and I'm now motivated to add more of it throughout the codebase - should improve performance in certain key areas.
To test:
Dashboard route is /dashboard/:userId
Try out the little sort buttons on the entries table heads, search didn't feel necessary for this table
Try out the search bar on the employees table, sort didn't feel necessary for this table
Changes:
Removed the (now unused) flowbite checkbox imports
Added SearchBar component to employees table
Added little "sort" buttons to entries table head cells
Made some style adjustments to employees table (md:w-full), the table looked funny with different-sized search results
Combined /admin/:userId/home route with /user/:userId/home route under a single new route /dashboard/:userId
I wrote a super simple search function for the employees table. It's a little slow which stack overflow leads me to believe is a result of updating search results on each keystroke rather than having a "search" button or something like that. I'm willing to sacrifice a little performance to leave it as it is. Update per keystroke is how I like my search bars but if your opinion differs we can change it. Might be able to improve performance a bit with a better search algorithm idk.
I had chatGPT figure out the sort logic for the entries table. It's a lot better than what I came up with. My machine overlord's apt use of the useMemo hook prompted me to learn more about memoization in general and I'm now motivated to add more of it throughout the codebase - should improve performance in certain key areas.
To test: Dashboard route is /dashboard/:userId
Changes: