mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-04-27 12:36:20 -04:00
25 lines
630 B
TypeScript
25 lines
630 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>
|
|
);
|
|
});
|
|
|
|
const reversed = sections.reverse();
|
|
|
|
return <>{reversed}</>;
|
|
}
|