import React, { useState } from "react";
import styles from "./VolunteersPage.module.css";
function Volunteer({ name, role, since, email, phone, photo }) {
const [isExpanded, setIsExpanded] = useState(false);
const toggleExpand = () => {
setIsExpanded(!isExpanded);
};
return (
{!isExpanded ? (
{name}
Rôle : {role}
Membre depuis : {since}
) : (
{name}
Rôle : {role}
Membre depuis : {since}
Email : {email}
Téléphone : {phone}
)}
{isExpanded && (
)}
);
}
function VolunteerPage() {
const volunteers = [
{
name: "LEBLOND Malo",
role: "Président",
since: "2019",
email: "malo.leblond@example.com",
phone: "08 67 87 32 21",
photo: "../src/assets/react.svg",
},
{
name: "DUPONT Jean",
role: "Bénévole",
since: "2020",
email: "jean.dupont@example.com",
phone: "06 12 34 56 78",
photo: "../src/assets/react.svg",
},
{
name: "MARTIN Sophie",
role: "Bénévole",
since: "2021",
email: "sophie.martin@example.com",
phone: "06 87 65 43 21",
photo: "../src/assets/react.svg",
},
{
name: "MARTIN Sophie",
role: "Bénévole",
since: "2021",
email: "sophie.martin@example.com",
phone: "06 87 65 43 21",
photo: "../src/assets/react.svg",
},
];
return (
{volunteers.map((volunteer, index) => (
))}
);
}
export default VolunteerPage;