diff --git a/src/Components/DashboardPage/Technician/TechnicianWidgets.tsx b/src/Components/DashboardPage/Technician/TechnicianWidgets.tsx index 23bcd80..188ea7d 100644 --- a/src/Components/DashboardPage/Technician/TechnicianWidgets.tsx +++ b/src/Components/DashboardPage/Technician/TechnicianWidgets.tsx @@ -81,7 +81,7 @@ export default function TechnicianWidgets() { ...{ float: "left", position: "absolute" }, }} > - SKUs in Inventory + Pending Equipments

- {queries[0].data ? queries[0].data.length : 0} + {queries[1].data?.filter( + (equipment) => equipment.status == "Pending" + ).length || 0}

- {queries[1].data ? queries[1].data.length : 0} + {queries[1].data?.length || 0}

@@ -163,11 +165,9 @@ export default function TechnicianWidgets() { ...styles.text_L, }} > - {queries[1].data - ? queries[1].data.filter( - (equipment) => equipment.status == "Available" - ).length - : 0} + {queries[1].data?.filter( + (equipment) => equipment.status == "Available" + ).length || 0}

- {queries[1].data - ? queries[1].data.filter( - (equipment) => equipment.status == "Broken" - ).length - : 0} + {queries[1].data?.filter( + (equipment) => equipment.status == "Broken" + ).length || 0}

@@ -244,14 +242,12 @@ export default function TechnicianWidgets() { ...styles.text_L, }} > - {queries[3].data - ? queries[3].data.filter((transaction) => - moment(transaction.timestamp, "MM-DD-YYYY hh:mm A").isBetween( - todayStartOfDay, - todayEndOfDay - ) - ).length - : 0} + {queries[3].data?.filter((transaction) => + moment(transaction.timestamp, "MM-DD-YYYY hh:mm A").isBetween( + todayStartOfDay, + todayEndOfDay + ) + ).length || 0}

- {queries[3].data - ? queries[3].data.filter((transaction) => - moment(transaction.timestamp, "MM-DD-YYYY hh:mm A").isBetween( - thisMonthStart, - thisMonthEnd - ) - ).length - : 0} + {queries[3].data?.filter((transaction) => + moment(transaction.timestamp, "MM-DD-YYYY hh:mm A").isBetween( + thisMonthStart, + thisMonthEnd + ) + ).length || 0}