fix: Division par 0

This commit is contained in:
N3WT DE COMPET
2025-05-29 08:43:59 +02:00
parent 55cb20bf8c
commit a42cf348a0

View File

@ -150,7 +150,11 @@ export default function DashboardPage() {
/>
<StatCard
title={t('capacityRate')}
value={`${((totalStudents / selectedEstablishmentTotalCapacity) * 100).toFixed(1)}%`}
value={
selectedEstablishmentTotalCapacity > 0
? `${((totalStudents / selectedEstablishmentTotalCapacity) * 100).toFixed(1)}%`
: 0
}
icon={<School className="text-orange-500" size={24} />}
color="orange"
/>