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}
</TableCell>
<TableCell align="center" component="th" scope="row">
{
equipment_instances.data?.filter(
(equipment_instance) =>
equipment_instance.equipment_name ==
equipment.name
).length
}
<div style={styles.flex_column}>
<p style={{ ...styles.text_dark, ...styles.text_S }}>
Available:
{
equipment_instances.data?.filter(
(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>
</TableRow>
))