correction ressource list, clean composant
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Athlete, Activite, Coach, Session, Ligne } from "../classes";
|
||||
import ObjectSession from "./object/session";
|
||||
|
||||
type AthleteListProps = { athletes: Athlete[] };
|
||||
type ActiviteListProps = { activites: Activite[] };
|
||||
@@ -6,6 +7,9 @@ type CoachListProps = { coachs: Coach[] };
|
||||
type SessionListProps = { sessions: Session[]};
|
||||
type LigneListProps = { lignes: Ligne[]};
|
||||
|
||||
|
||||
|
||||
|
||||
function AthleteList({ athletes }: AthleteListProps) {
|
||||
return (
|
||||
<ul className="AthleteList">
|
||||
@@ -56,28 +60,12 @@ function CoachList({ coachs }: CoachListProps) {
|
||||
|
||||
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>
|
||||
<div>
|
||||
<strong>Ligne:</strong> {sessions.ligne ? sessions.ligne.map(ligne => ligne.nom).join(", ") : "Pas de ligne sur la séance"}
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<div className="list_object">
|
||||
{sessions.map((session) => (
|
||||
<ObjectSession session={session}/>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user