Improved tally page

This commit is contained in:
Keannu Bernasol 2024-01-05 19:31:37 +08:00
parent 0d32ce61cb
commit ff18a7a60c

View file

@ -194,13 +194,41 @@ export default function EquipmentTallyPage() {
{equipment.category} {equipment.category}
</TableCell> </TableCell>
<TableCell align="center" component="th" scope="row"> <TableCell align="center" component="th" scope="row">
<div style={styles.flex_column}>
<p style={{ ...styles.text_dark, ...styles.text_S }}>
Available:
{ {
equipment_instances.data?.filter( equipment_instances.data?.filter(
(equipment_instance) => (equipment_instance) =>
equipment_instance.equipment_name == equipment_instance.equipment_name ==
equipment.name equipment.name &&
equipment_instance.status == "Available"
).length ).length
} }
</p>
<p style={{ ...styles.text_dark, ...styles.text_S }}>
Pending:
{
equipment_instances.data?.filter(
(equipment_instance) =>
equipment_instance.equipment_name ==
equipment.name &&
equipment_instance.status == "Pending"
).length
}
</p>
<p style={{ ...styles.text_dark, ...styles.text_S }}>
Broken:
{
equipment_instances.data?.filter(
(equipment_instance) =>
equipment_instance.equipment_name ==
equipment.name &&
equipment_instance.status == "Broken"
).length
}
</p>
</div>
</TableCell> </TableCell>
</TableRow> </TableRow>
)) ))