From d874732f4c781f1de35494d52fbf4c7b3e3c715b Mon Sep 17 00:00:00 2001 From: miwaaa <76200991+miwaaa@users.noreply.github.com> Date: Tue, 22 Apr 2025 16:01:22 +0800 Subject: [PATCH] Create Cold Boxes Inventory (Nera Boxes) To track the cycle of Nera Box(es) --- coldboxinventory | 58 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 coldboxinventory diff --git a/coldboxinventory b/coldboxinventory new file mode 100644 index 000000000..67565e212 --- /dev/null +++ b/coldboxinventory @@ -0,0 +1,58 @@ +import { useState } from "react"; + +const initialBoxes = [ + { id: 1, name: "BOX 1", cycles: 19 }, + { id: 2, name: "BOX 2", cycles: 19 }, + { id: 3, name: "BOX 3", cycles: 20 }, + { id: 4, name: "BOX 4", cycles: 20 }, + { id: 5, name: "BOX 5", cycles: 70 }, + { id: 6, name: "BOX 6", cycles: 70 }, + { id: 7, name: "BOX 7", cycles: 70 }, + { id: 8, name: "BOX 8", cycles: 70 }, + { id: 9, name: "BOX 9", cycles: 70 }, + { id: 10, name: "BOX 10", cycles: 70 }, + { id: 11, name: "BOX 11", cycles: 69 }, + { id: 12, name: "BOX 12", cycles: 69 }, + { id: 13, name: "BOX 13", cycles: 69 }, + { id: 14, name: "BOX 14", cycles: 69 }, +]; + +export default function ColdBoxInventory() { + const [boxes, setBoxes] = useState(initialBoxes); + + const incrementCycle = (id) => { + setBoxes((prevBoxes) => + prevBoxes.map((box) => + box.id === id && box.cycles < 70 + ? { ...box, cycles: box.cycles + 1 } + : box + ) + ); + }; + + const getCycleColor = (cycles) => { + if (cycles >= 70) return "bg-red-500 text-white"; + if (cycles >= 60) return "bg-yellow-300"; + return "bg-green-200"; + }; + + return ( +
+

Cold Box Cycle Tracker

+
+ {boxes.map((box) => ( +
incrementCycle(box.id)} + > +

{box.name}

+

Cycles: {box.cycles}

+
+ ))} +
+
+ ); +} pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy