diff --git a/src/routes/Inventory/Inventory.tsx b/src/routes/Inventory/Inventory.tsx index d9112c5..a37534d 100644 --- a/src/routes/Inventory/Inventory.tsx +++ b/src/routes/Inventory/Inventory.tsx @@ -22,36 +22,36 @@ export default function Inventory() { } } function StockRender(in_stock: number) { - const [stock, setStock] = useState("" + in_stock); - if (in_stock > 0 && in_stock < 3) { + const [stock, setStock] = useState(in_stock); + if (stock >= 0 && stock <= 3) { return ( - + ) => { if (is_number(e.target.value) === true) { - setStock(e.target.value); + setStock(parseInt(e.target.value)); } }} /> ); - } else if (in_stock > 3 && in_stock < 9) { + } else if (stock >= 4 && stock < 9) { return ( - + ) => { if (is_number(e.target.value) === true) { - setStock(e.target.value); + setStock(parseInt(e.target.value)); } }} /> @@ -59,16 +59,16 @@ export default function Inventory() { ); } else { return ( - + ) => { if (is_number(e.target.value) === true) { - setStock(e.target.value); + setStock(parseInt(e.target.value)); } }} />