Allow users to add trucks to their wishlist directly from the listings page for easy access and tracking of desired items.
Requirements:
Wishlist Button:
Add a heart-shaped icon (or similar) on each listing card.
When clicked, the icon changes to a filled state indicating the truck is added to the wishlist.
User Feedback:
Display a tooltip or a small toast message, e.g., “Added to Wishlist,” upon a successful action.
Integration with Wishlist:
The truck should be saved in the user's wishlist, accessible from their dashboard.
If a user clicks the filled icon, the truck is removed from the wishlist, with a corresponding feedback message, e.g., “Removed from Wishlist.”
Logged-in State Requirement:
If the user is not logged in, clicking the wishlist button prompts them to log in or sign up.
UI Behavior:
Ensure the icon's filled/empty state persists across page reloads, based on the user's saved wishlist.
Performance:
API calls for adding/removing from the wishlist should be lightweight and asynchronous for seamless interaction.
Testing:
Verify functionality across desktop and mobile views.
Ensure wishlist updates are synced across devices when the same account is used.
