diff --git a/frontend/src/components/Machines.js b/frontend/src/components/Machines.js index 06ff0e3..9ed3eae 100644 --- a/frontend/src/components/Machines.js +++ b/frontend/src/components/Machines.js @@ -34,6 +34,7 @@ function Machines({ machines, onSelect }) { Machines + {machineItems} diff --git a/frontend/src/components/ProductCard.js b/frontend/src/components/ProductCard.js new file mode 100644 index 0000000..24eb95d --- /dev/null +++ b/frontend/src/components/ProductCard.js @@ -0,0 +1,31 @@ +import * as React from "react"; +import Card from "@mui/material/Card"; +import CardContent from "@mui/material/CardContent"; +import CardMedia from "@mui/material/CardMedia"; +import Typography from "@mui/material/Typography"; +import { CardActionArea } from "@mui/material"; + +function ProductCard({ product }) { + return ( + + + + + + {product.name} + + + {product.description} + + + + + ); +} + +export { ProductCard }; diff --git a/frontend/src/components/Products.js b/frontend/src/components/Products.js index 7d0030d..058147f 100644 --- a/frontend/src/components/Products.js +++ b/frontend/src/components/Products.js @@ -1,11 +1,26 @@ +import * as React from "react"; +import Grid from "@mui/material/Unstable_Grid2"; import Typography from "@mui/material/Typography"; +import { ProductCard } from "./ProductCard"; function Products({ machineName, products, onSelect }) { + const productItems = products.map((product) => { + return ( + + + + ); + }); + return ( <> Products - {machineName} + + + {productItems} + ); } diff --git a/frontend/src/pages/Home.js b/frontend/src/pages/Home.js index 8a179dd..bd83bcd 100644 --- a/frontend/src/pages/Home.js +++ b/frontend/src/pages/Home.js @@ -30,10 +30,10 @@ function Home() { return ( - + - + {productsData && }