diff --git a/pages/rencontres/index.js b/pages/rencontres/index.js index e7bfc26..515f5af 100644 --- a/pages/rencontres/index.js +++ b/pages/rencontres/index.js @@ -258,17 +258,42 @@ export default function Rencontres({ base, region, pilier, thematique }){ )} {modules.length > 0 ? (
- {modules.map((module, index) => ( -
- -
- ))} + {!switcher ? + modules.map((module, index) => ( + <> +
+ +
+ + )) : modules.map((module, index) => { + const publishedUpcomingSessions = module.sessions.filter(session => { + const isPublished = session.status === "publish"; + const isUpcoming = new Date(session.dateDebut) > new Date(); + return isPublished && isUpcoming; + }); + + if (publishedUpcomingSessions.length > 0) { + return ( +
+ +
+ ); + } + return null; + }) + }
) : (