1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-27 12:36:20 -04:00
2021-12-30 08:18:41 -05:00

23 lines
600 B
TypeScript

import ListItem from "./ListItem";
import styles from "./List.module.scss";
export default function List({ allNotes }) {
const sections = [];
Object.entries(allNotes).forEach(([year, notes]: [string, any]) => {
sections.push(
<section key={year} className={styles.section}>
<h2 className={styles.year}>{year}</h2>
<ul className={styles.list}>
{notes.map((note) => (
<ListItem key={note.slug} title={note.title} date={note.date} slug={note.slug} />
))}
</ul>
</section>
);
});
return <>{sections.reverse()}</>;
}