Feat: Ajout de la classe ligne pour la partie 2.
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import { Athlete, Activite, Coach, Session } from "../classes";
|
||||
import { Athlete, Activite, Coach, Session, Ligne } from "../classes";
|
||||
|
||||
type AthleteListProps = { athletes: Athlete[] };
|
||||
type ActiviteListProps = { activites: Activite[] };
|
||||
type CoachListProps = { coachs: Coach[] };
|
||||
type SessionListProps = { sessions: Session[]};
|
||||
type LigneListProps = { lignes: Ligne[]};
|
||||
|
||||
function AthleteList({ athletes }: AthleteListProps) {
|
||||
return (
|
||||
@@ -70,6 +71,9 @@ function SessionList({ sessions }: SessionListProps) {
|
||||
<div>
|
||||
<strong>Coach:</strong> {sessions.coach ? sessions.coach.nom : "Pas de coach sur la séance"}
|
||||
</div>
|
||||
<div>
|
||||
<strong>Ligne:</strong> {sessions.ligne ? sessions.ligne.map(ligne => ligne.nom).join(", ") : "Pas de ligne sur la séance"}
|
||||
</div>
|
||||
|
||||
</li>
|
||||
))}
|
||||
@@ -77,4 +81,33 @@ function SessionList({ sessions }: SessionListProps) {
|
||||
);
|
||||
}
|
||||
|
||||
export { AthleteList, ActiviteList, CoachList , SessionList };
|
||||
function LigneList({ lignes }: LigneListProps) {
|
||||
return (
|
||||
<ul className="LigneList">
|
||||
{lignes.map((lignes) => (
|
||||
<li key={lignes.id}>
|
||||
<div>
|
||||
<strong>Nom:</strong> {lignes.nom}
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
<strong>Composition :</strong>
|
||||
<ul>
|
||||
{lignes.composition.map((athlete) => (
|
||||
<li key={athlete.id}>
|
||||
{athlete.nom}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<strong>Temps de jeu: {lignes.tempsDeJeu}</strong>
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
);
|
||||
}
|
||||
|
||||
export { AthleteList, ActiviteList, CoachList , SessionList, LigneList };
|
||||
Reference in New Issue
Block a user