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}>
equipment_instances.data?.filter( <p style={{ ...styles.text_dark, ...styles.text_S }}>
(equipment_instance) => Available:
equipment_instance.equipment_name == {
equipment.name equipment_instances.data?.filter(
).length (equipment_instance) =>
} equipment_instance.equipment_name ==
equipment.name &&
equipment_instance.status == "Available"
).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>
)) ))