diff --git a/hackathon_site/dashboard/frontend/src/components/inventory/Item/Item.tsx b/hackathon_site/dashboard/frontend/src/components/inventory/Item/Item.tsx index 9c7c33c..bf3566b 100644 --- a/hackathon_site/dashboard/frontend/src/components/inventory/Item/Item.tsx +++ b/hackathon_site/dashboard/frontend/src/components/inventory/Item/Item.tsx @@ -15,7 +15,7 @@ interface ItemProps { const Item = ({ image, title, total, currentStock }: ItemProps): ReactElement => { const userType = useSelector(userTypeSelector); - const stock = !currentStock + const stock = !currentStock || currentStock < 0 ? "OUT OF STOCK" : userType === "participant" ? currentStock + " IN STOCK" diff --git a/hackathon_site/dashboard/frontend/src/components/inventory/ProductOverview/ProductOverview.tsx b/hackathon_site/dashboard/frontend/src/components/inventory/ProductOverview/ProductOverview.tsx index 3a8f847..7d89e96 100644 --- a/hackathon_site/dashboard/frontend/src/components/inventory/ProductOverview/ProductOverview.tsx +++ b/hackathon_site/dashboard/frontend/src/components/inventory/ProductOverview/ProductOverview.tsx @@ -230,21 +230,29 @@ export const DetailInfoSection = ({ Manufacturer {manufacturer} - - Model Number - - {modelNumber} - - Datasheet - - + {modelNumber && ( + <> + + Model Number + + {modelNumber} + + )} + {datasheet && ( + <> + + Datasheet + + + + )} {notes && ( <> @@ -279,11 +287,11 @@ const MainSection = ({ OUT OF STOCK ) : userType === "participant" ? ( - {quantityRemaining} IN STOCK + {Math.max(quantityRemaining, 0)} IN STOCK ) : ( - {quantityRemaining} OF {quantityAvailable} IN STOCK + {Math.max(quantityRemaining, 0)} OF {quantityAvailable} IN STOCK );