chore: Capacité de l'établissement retourné en variable de session /

login sur la home page
This commit is contained in:
N3WT DE COMPET
2025-05-22 18:47:19 +02:00
parent 3b667d3b15
commit 87b8cf6c05
6 changed files with 54 additions and 32 deletions

View File

@ -38,7 +38,8 @@ export default function DashboardPage() {
});
const [classes, setClasses] = useState([]);
const { selectedEstablishmentId } = useEstablishment();
const { selectedEstablishmentId, selectedEstablishmentTotalCapacity } =
useEstablishment();
const { showNotification } = useNotification();
useEffect(() => {
@ -116,13 +117,13 @@ export default function DashboardPage() {
/>
<StatCard
title={t('structureCapacity')}
value={`${structureCapacity}`}
value={`${selectedEstablishmentTotalCapacity}`}
icon={<School className="text-green-500" size={24} />}
color="emerald"
/>
<StatCard
title={t('capacityRate')}
value={`${((totalStudents / structureCapacity) * 100).toFixed(1)}%`}
value={`${((totalStudents / selectedEstablishmentTotalCapacity) * 100).toFixed(1)}%`}
icon={<School className="text-orange-500" size={24} />}
color="orange"
/>