mirror of
https://github.com/lemeow125/Borrowing-TrackerFrontend.git
synced 2024-11-17 06:19:27 +08:00
Optimized code for technician widget and changed widget to pending equipments
This commit is contained in:
parent
4cd5712f6f
commit
928782d80d
1 changed files with 23 additions and 29 deletions
|
@ -81,7 +81,7 @@ export default function TechnicianWidgets() {
|
||||||
...{ float: "left", position: "absolute" },
|
...{ float: "left", position: "absolute" },
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
SKUs in Inventory
|
Pending Equipments
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p
|
<p
|
||||||
|
@ -90,7 +90,9 @@ export default function TechnicianWidgets() {
|
||||||
...styles.text_L,
|
...styles.text_L,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{queries[0].data ? queries[0].data.length : 0}
|
{queries[1].data?.filter(
|
||||||
|
(equipment) => equipment.status == "Pending"
|
||||||
|
).length || 0}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
@ -121,7 +123,7 @@ export default function TechnicianWidgets() {
|
||||||
...styles.text_L,
|
...styles.text_L,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{queries[1].data ? queries[1].data.length : 0}
|
{queries[1].data?.length || 0}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -163,11 +165,9 @@ export default function TechnicianWidgets() {
|
||||||
...styles.text_L,
|
...styles.text_L,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{queries[1].data
|
{queries[1].data?.filter(
|
||||||
? queries[1].data.filter(
|
|
||||||
(equipment) => equipment.status == "Available"
|
(equipment) => equipment.status == "Available"
|
||||||
).length
|
).length || 0}
|
||||||
: 0}
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
@ -198,11 +198,9 @@ export default function TechnicianWidgets() {
|
||||||
...styles.text_L,
|
...styles.text_L,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{queries[1].data
|
{queries[1].data?.filter(
|
||||||
? queries[1].data.filter(
|
|
||||||
(equipment) => equipment.status == "Broken"
|
(equipment) => equipment.status == "Broken"
|
||||||
).length
|
).length || 0}
|
||||||
: 0}
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -244,14 +242,12 @@ export default function TechnicianWidgets() {
|
||||||
...styles.text_L,
|
...styles.text_L,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{queries[3].data
|
{queries[3].data?.filter((transaction) =>
|
||||||
? queries[3].data.filter((transaction) =>
|
|
||||||
moment(transaction.timestamp, "MM-DD-YYYY hh:mm A").isBetween(
|
moment(transaction.timestamp, "MM-DD-YYYY hh:mm A").isBetween(
|
||||||
todayStartOfDay,
|
todayStartOfDay,
|
||||||
todayEndOfDay
|
todayEndOfDay
|
||||||
)
|
)
|
||||||
).length
|
).length || 0}
|
||||||
: 0}
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
@ -282,14 +278,12 @@ export default function TechnicianWidgets() {
|
||||||
...styles.text_L,
|
...styles.text_L,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{queries[3].data
|
{queries[3].data?.filter((transaction) =>
|
||||||
? queries[3].data.filter((transaction) =>
|
|
||||||
moment(transaction.timestamp, "MM-DD-YYYY hh:mm A").isBetween(
|
moment(transaction.timestamp, "MM-DD-YYYY hh:mm A").isBetween(
|
||||||
thisMonthStart,
|
thisMonthStart,
|
||||||
thisMonthEnd
|
thisMonthEnd
|
||||||
)
|
)
|
||||||
).length
|
).length || 0}
|
||||||
: 0}
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue