import Link from "next/link"; import { format, parseISO } from "date-fns"; import styles from "./List.module.scss"; type NoteProps = { title: string; date: string; slug: string; }; export default function List({ notesByYear }) { const sections = []; Object.entries(notesByYear).forEach(([year, notes]: [string, NoteProps[]]) => { sections.push(

{year}

); }); // grouped notes enter this component ordered chronologically -- we want reverse chronological const reversed = sections.reverse(); return <>{reversed}; }