diff --git a/src/pages/index.astro b/src/pages/index.astro index c44f99c..677ddf3 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -3,7 +3,7 @@ import { getCollection } from "astro:content"; import Layout from "../layouts/Layout.astro"; import Card from "../components/Card.astro"; import EventCard from "../components/EventCard.astro"; -import BankCard from "../components/BankCard.astro"; // <-- AJOUT +import BankCard from "../components/BankCard.astro"; // 1. Récupération des données const allHumans = await getCollection("humans", ({ id }) => { @@ -26,7 +26,7 @@ const latestEvent = allEvents.sort( (a, b) => new Date(a.data.date).getTime() - new Date(b.data.date).getTime(), )[0]; -// 3. Logique de Streak (Série) - TON CODE ORIGINAL +// 3. Logique de Streak (Série) const getStreak = (name: any, entries: any) => { const userDates = entries .filter((e: any) => e.data.name === name) @@ -84,7 +84,7 @@ const getStreak = (name: any, entries: any) => { // 4. Sélection de la carte principale const latestPerUser = Array.from( sortedAll - .reduce((map, obj) => { + .reduce((map: any, obj: any) => { if (!map.has(obj.data.name)) map.set(obj.data.name, obj); return map; }, new Map()) @@ -104,15 +104,21 @@ const latestPerUser = Array.from(

Ambient

-
- { - latestPerUser.map((entry) => { - const currentStreak = getStreak(entry.data.name, allHumans); - return ( +
+ + +
+ +