-
-
-
Products
+
+
+
+
+
+
-
-
+
+
+
+
+ Product ID
+ Product
+ Last Modified
+
+
+
+ {SampleProducts.map((row) => (
+
+ {row.id}
+ {row.name}
+ {row.last_modified}
+
+ ))}
+
+
+
);
}
diff --git a/src/components/Icons/AddIcon/AddIcon.tsx b/src/components/Icons/AddIcon/AddIcon.tsx
index c0bf219..8054588 100644
--- a/src/components/Icons/AddIcon/AddIcon.tsx
+++ b/src/components/Icons/AddIcon/AddIcon.tsx
@@ -6,10 +6,18 @@ export interface props {
}
export default function AddIcon(props: props) {
return (
-
+
);
}
diff --git a/src/components/Icons/CancelIcon/CancelIcon.tsx b/src/components/Icons/CancelIcon/CancelIcon.tsx
index cefe1a8..9d32509 100644
--- a/src/components/Icons/CancelIcon/CancelIcon.tsx
+++ b/src/components/Icons/CancelIcon/CancelIcon.tsx
@@ -7,21 +7,19 @@ export interface props {
export default function CancelIcon(props: props) {
return (
-
+
);
}
diff --git a/src/components/Icons/DeleteIcon/DeleteIcon.tsx b/src/components/Icons/DeleteIcon/DeleteIcon.tsx
index c67f0d7..4386252 100644
--- a/src/components/Icons/DeleteIcon/DeleteIcon.tsx
+++ b/src/components/Icons/DeleteIcon/DeleteIcon.tsx
@@ -6,12 +6,20 @@ export interface props {
}
export default function DeleteIcon(props: props) {
return (
-
+
);
}
diff --git a/src/components/Icons/EditIcon/EditIcon.tsx b/src/components/Icons/EditIcon/EditIcon.tsx
index 3c497de..e98d881 100644
--- a/src/components/Icons/EditIcon/EditIcon.tsx
+++ b/src/components/Icons/EditIcon/EditIcon.tsx
@@ -6,14 +6,22 @@ export interface props {
}
export default function EditIcon(props: props) {
return (
-
+
);
}
diff --git a/src/components/ProductInfo/ProductInfo.tsx b/src/components/ProductInfo/ProductInfo.tsx
deleted file mode 100644
index 1e2aca1..0000000
--- a/src/components/ProductInfo/ProductInfo.tsx
+++ /dev/null
@@ -1,92 +0,0 @@
-import { Table, TableBody, TableCell, TableContainer, TableHead, TableRow } from '@mui/material';
-import { ProductType } from '../ProductType/ProductType';
-import { useNavigate } from 'react-router-dom';
-import styles from '../../styles';
-import EditIcon from "../../Components/Icons/EditIcon/EditIcon";
-import DeleteIcon from "../../Components/Icons/DeleteIcon/DeleteIcon";
-import ProductsLists from "../../Components/ProductsLists/ProductsLists";
-
-type ProductInfoProps = {
- products: ProductType[];
-};
-
-export default function ProductInfo(props: ProductInfoProps) {
- const { products } = props;
- const navigate = useNavigate();
-
- const handleEdit = (id: number) => {
- navigate(`/Products/EditProduct/${id.toString().padStart(3, '0')}`);
- };
-
- const handleDelete = (id: number) => {
- const newProductsList = products.filter(product => product.id !== id);
- console.log(`Deleting product with ID ${id}`);
- console.log(newProductsList); // optional, to check that the product was removed from the array
- ProductsLists.splice(id-1, 1,);
- };
-
- const getStocksColor = (stocks: number) => {
- if (stocks >= 10) {
- return 'green';
- } else if (stocks >= 4) {
- return 'orange';
- } else {
- return 'red';
- }
- };
-
- return (
-
-
-
-
- Product ID
- Product Name
- Last Modified
- Actions
-
-
-
- {products.map((product) => (
-
- {product.id.toString().padStart(3, '0')}
- {product.name}
- {product.lastModified}
-
-
-
-
-
-
-
- ))}
-
-
-
- );
-}
diff --git a/src/routes/Inventory/Inventory.tsx b/src/routes/Inventory/Inventory.tsx
index a8c217a..961ee54 100644
--- a/src/routes/Inventory/Inventory.tsx
+++ b/src/routes/Inventory/Inventory.tsx
@@ -1,8 +1,16 @@
import React from "react";
import styles from "../../styles";
import InventoryIcon from "../../Components/Icons/InventoryIcon/InventoryIcon";
-import InventoryInfo from "../../Components/InventoryInfo/InventoryInfo";
-import ProductsLists from "../../Components/ProductsLists/ProductsLists";
+import {
+ Button,
+ Table,
+ TableBody,
+ TableCell,
+ TableContainer,
+ TableHead,
+ TableRow,
+} from "@mui/material";
+import { SampleInventoryData } from "../../Components/SampleData/SampleData";
export default function Inventory() {
return (
@@ -11,7 +19,34 @@ export default function Inventory() {
Inventory
-