-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: restyle the list header and add infos contents
- Loading branch information
1 parent
893ccf8
commit 7c31328
Showing
4 changed files
with
218 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import { | ||
Group as GroupIcon, | ||
Diversity2 as StudentIcon, | ||
Female as FemaleIcon, | ||
Male as MaleIcon, | ||
School as SchoolIcon, | ||
UploadFile as UploadFileIcon, | ||
Work as WorkIcon, | ||
CheckCircle as EnabledIcon, | ||
PersonOff as DisabledIcon, | ||
PersonRemove as SuspendedIcon, | ||
} from "@mui/icons-material"; | ||
|
||
export const getCommonListHeaderContent = (stats) => { | ||
const totalStudents = stats.men.total + stats.women.total; | ||
return [ | ||
{ | ||
title: "Étudiants", | ||
icon: <StudentIcon fontSize="medium" />, | ||
total: isNaN(totalStudents) ? "" : totalStudents, | ||
statDetails: [ | ||
{ | ||
icon: <EnabledIcon fontSize="small" color="success" />, | ||
total: stats.women.enabled + stats.men.enabled, | ||
title: "Actif.ve.s", | ||
}, | ||
{ | ||
icon: <SuspendedIcon fontSize="small" color="warning" />, | ||
total: stats.women.suspended + stats.men.suspended, | ||
title: "Suspendu.e.s", | ||
}, | ||
{ | ||
icon: <DisabledIcon fontSize="small" color="error" />, | ||
total: stats.women.disabled + stats.men.disabled, | ||
title: "Quitté.e.s", | ||
}, | ||
], | ||
}, | ||
{ | ||
title: "Femmes", | ||
icon: <FemaleIcon fontSize="medium" />, | ||
total: stats.women.total, | ||
statDetails: [ | ||
{ | ||
icon: <EnabledIcon fontSize="small" color="success" />, | ||
total: stats.women.enabled, | ||
title: "Actif.ve.s", | ||
}, | ||
{ | ||
icon: <SuspendedIcon fontSize="small" color="warning" />, | ||
total: stats.women.suspended, | ||
title: "Suspendu.e.s", | ||
}, | ||
{ | ||
icon: <DisabledIcon fontSize="small" color="error" />, | ||
total: stats.women.disabled, | ||
title: "Quitté.e.s", | ||
}, | ||
], | ||
}, | ||
{ | ||
title: "Hommes", | ||
icon: <MaleIcon fontSize="medium" />, | ||
total: stats.men.total, | ||
statDetails: [ | ||
{ | ||
icon: <EnabledIcon fontSize="small" color="success" />, | ||
total: stats.men.enabled, | ||
title: "Actif.ve.s", | ||
}, | ||
{ | ||
icon: <SuspendedIcon fontSize="small" color="warning" />, | ||
total: stats.men.suspended, | ||
title: "Suspendu.e.s", | ||
}, | ||
{ | ||
icon: <DisabledIcon fontSize="small" color="error" />, | ||
total: stats.men.disabled, | ||
title: "Quitté.e.s", | ||
}, | ||
], | ||
}, | ||
]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.