import Link from "next/link"; import { format } from "date-fns"; import styles from "./List.module.css"; type NoteProps = { title: string; htmlTitle?: string; date: string; slug: string; }; const 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}; }; export default List;