Feat: Ajout liste des sessions pour admin et coach

This commit is contained in:
Amaël Kesteman
2026-01-07 16:19:31 +01:00
parent 30b27e7420
commit 9878357c71
3 changed files with 67 additions and 13 deletions

View File

@@ -1,8 +1,9 @@
import { Athlete, Activite, Coach } from "../classes";
import { Athlete, Activite, Coach, Session } from "../classes";
type AthleteListProps = { athletes: Athlete[] };
type ActiviteListProps = { activites: Activite[] };
type CoachListProps = { coachs: Coach[] };
type SessionListProps = { sessions: Session[]};
function AthleteList({ athletes }: AthleteListProps) {
return (
@@ -52,4 +53,28 @@ function CoachList({ coachs }: CoachListProps) {
);
}
export { AthleteList, ActiviteList, CoachList };
function SessionList({ sessions }: SessionListProps) {
return (
<ul className="SessionList">
{sessions.map((sessions) => (
<li key={sessions.id}>
<div>
<strong>Nom:</strong> {sessions.name}
</div>
<div>
<strong>Groupe:</strong> {sessions.groupe}
</div>
<div>
<strong>Recurrent:</strong> {sessions.isRecurrent ? "Oui" : "Non"}
</div>
<div>
<strong>Coach:</strong> {sessions.coach ? sessions.coach.nom : "Pas de coach sur la séance"}
</div>
</li>
))}
</ul>
);
}
export { AthleteList, ActiviteList, CoachList , SessionList };