You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The EntreesPage component displays a list of available entrees and allows the user to increment or decrement the quantity of each item. It also provides a summary of selected entrees and their total price.
Key Features
Dynamic Entree List: Displays a list of entrees fetched via an API (tRPC).
Quantity Adjustment: Users can adjust the quantity of each entree and remove them if the quantity reaches zero.
Order Summary: The component summarizes the user's selected entrees and their total price.
This component handles loading and error states, fetches entree items via the api.menu.getMenuItemsByType query, and manages state for the selected entrees using useState.
Functions
incrementItem: Increments the quantity of an entree.
decrementItem: Decreases the quantity of an entree or removes it from the selection if the quantity is 0.