The first page in our admin panel is the orders page, where we need to display a list of all orders placed by our customers. This sounds incredibly similar to the order list component that we built for displaying the customer-specific list of orders on the my account page. Rather than repeat ourselves, we can make some minor tweaks to the existing component so that it can be used in both contexts.
From the perspective of a customer, it's already doing what it needs to do, as the orders it displays are passed in via props, and are limited to only those orders placed by the currently logged in customer. From the perspective of an admin, we can display the orders for all customers by simply passing in a different ...