The NewProduct component will be similar to the NewShop component. It will contain a form that allows a seller to create a product by entering a name, description, category, quantity, and price, and uploading a product image file from their local filesystem:
This NewProduct component will only load at a route that is associated with a specific shop, so only signed-in users who are sellers can add a product to a shop they own. To define this route, we add a PrivateRoute in the MainRouter component, which will render this form only for authorized users at /seller/:shopId/products/new.
mern-marketplace/client/MainRouter.js ...