nag butang kog total, borrowed pud, gifix ang magin top, coloran lang og red ang broken.

This commit is contained in:
Pongot, Jophiel 2024-01-10 06:30:14 +08:00
parent 44341e2645
commit f139a508b2

View file

@ -65,6 +65,7 @@ export default function EquipmentTallyPage() {
width: "100%",
minHeight: "100%",
minWidth: "100%",
marginTop: "6rem"
}}
>
<div
@ -192,7 +193,7 @@ export default function EquipmentTallyPage() {
<TableCell align="center" component="th" scope="row">
<div style={styles.flex_column}>
<p style={{ ...styles.text_dark, ...styles.text_S }}>
Available:
Available: {"\n"}
{
equipment_instances.data?.filter(
(equipment_instance) =>
@ -203,7 +204,7 @@ export default function EquipmentTallyPage() {
}
</p>
<p style={{ ...styles.text_dark, ...styles.text_S }}>
Pending:
Pending: {"\n"}
{
equipment_instances.data?.filter(
(equipment_instance) =>
@ -214,7 +215,18 @@ export default function EquipmentTallyPage() {
}
</p>
<p style={{ ...styles.text_dark, ...styles.text_S }}>
Broken:
Borrowed: {"\n"}
{
equipment_instances.data?.filter(
(equipment_instance) =>
equipment_instance.equipment_name ==
equipment.name &&
equipment_instance.status == "Borrowed"
).length
}
</p>
<p style={{ ...styles.text_dark, ...styles.text_S, color: colors.red }}>
Broken: {"\n"}
{
equipment_instances.data?.filter(
(equipment_instance) =>
@ -224,6 +236,20 @@ export default function EquipmentTallyPage() {
).length
}
</p>
<div style={{ borderTop: "1px solid #000", minWidth: "40%", alignSelf: "center" }}>
<p
style={{ ...styles.text_dark, ...styles.text_s }}
>
Total: {"\n"}
{
equipment_instances.data?.filter(
(equipment_instance) =>
equipment_instance.equipment_name ===
equipment.name
).length
}
</p>
</div>
</div>
</TableCell>
</TableRow>