Feat: Ajout de la liste pour les coachs visible que par les admins et la classe de test avec
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
import { Athlete, Activite } from "../classes";
|
||||
import { Athlete, Activite, Coach } from "../classes";
|
||||
|
||||
type Props = {
|
||||
athletes: Athlete[];
|
||||
activites: Activite[];
|
||||
type AthleteListProps = { athletes: Athlete[] };
|
||||
type ActiviteListProps = { activites: Activite[] };
|
||||
type CoachListProps = { coachs: Coach[] };
|
||||
|
||||
};
|
||||
|
||||
function AthleteList({ athletes }: Props) {
|
||||
function AthleteList({ athletes }: AthleteListProps) {
|
||||
return (
|
||||
<ul className="AthleteList">
|
||||
{athletes.map((athlete) => (
|
||||
@@ -19,7 +17,7 @@ function AthleteList({ athletes }: Props) {
|
||||
);
|
||||
}
|
||||
|
||||
function ActiviteList({ activites }: Props) {
|
||||
function ActiviteList({ activites }: ActiviteListProps) {
|
||||
return (
|
||||
<ul className="ActiviteList">
|
||||
{activites.map((activite) => (
|
||||
@@ -39,4 +37,19 @@ function ActiviteList({ activites }: Props) {
|
||||
);
|
||||
}
|
||||
|
||||
export { AthleteList, ActiviteList };
|
||||
function CoachList({ coachs }: CoachListProps) {
|
||||
return (
|
||||
<ul className="CoachList">
|
||||
{coachs.map((coachs) => (
|
||||
<li key={coachs.id}>
|
||||
<div>
|
||||
<strong>Nom:</strong> {coachs.nom}
|
||||
</div>
|
||||
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
);
|
||||
}
|
||||
|
||||
export { AthleteList, ActiviteList, CoachList };
|
||||
Reference in New Issue
Block a user