diff --git a/GrossesMitaines/grosses-mitaines-ui/src/components/SimpleItem.js b/GrossesMitaines/grosses-mitaines-ui/src/components/SimpleItem.js index 5dd1ece..807436d 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/components/SimpleItem.js +++ b/GrossesMitaines/grosses-mitaines-ui/src/components/SimpleItem.js @@ -1,6 +1,29 @@ import { FaTimes } from 'react-icons/fa' import { FaTools } from 'react-icons/fa' +function renderStatus(statusCode) { + if (statusCode !== undefined) { + + switch (statusCode) { + case 0: + return ("Disponible"); + case 1: + return ("En commande"); + case 2: + return ("Indisponible"); + case 3: + return ("Liquidation"); + case 4: + return ("Promotion"); + case 5: + return ("Discontinué"); + default: + return (<>>); + } + } + +} + const SimpleItem = ({ item, onDelete, onModify }) => { return (
Categoie: {item.category}, Prix: {item.price}, Promo: {item.promoPrice}, Quantité: {item.quantity}
+Categoie: {item.category}, Prix: {item.price}, Promo: {item.promoPrice}, Quantité: {item.quantity}, Disponibilité: {renderStatus(item.status)}
Description: {item.description}
) diff --git a/GrossesMitaines/grosses-mitaines-ui/src/stylesheets/site.css b/GrossesMitaines/grosses-mitaines-ui/src/stylesheets/site.css index 5067a8c..3b7e18c 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/stylesheets/site.css +++ b/GrossesMitaines/grosses-mitaines-ui/src/stylesheets/site.css @@ -436,6 +436,7 @@ html { display: inline-block; height: auto; width: 97.5%; + padding: 1.25%; }