--- import SectionContainer from '../../components/SectionContainer.astro'; import tv from '../../data/watchlist.json' let watched = []; let currently = []; tv.lists.forEach(list => { switch (list.name) { case "Watched": watched = list.tv; break; case "Currently watching": currently = list.tv; break; } }); const tvByYear = watched.reduce((acc, tv) => { const year = new Date(tv.date.string).getFullYear(); if (!acc[year]) { acc[year] = []; } acc[year].push(tv); return acc; }, {}); const sortedYears = Object.keys(tvByYear).sort((a: any, b: any) => b - a); ---

📺 La télévision

on the screen

{sortedYears.map(year => (
{year} ({tvByYear[year].length} entries)
    { tvByYear[year].map(tv => (
  • {tv.title}

    {tv.type}

    {tv.rating === 5 ? "❤️" : ""}

  • )) }
))}