www/components/recent-notes.tsx
Paul W. e3c70632e2
Add programming-resources; swi->generic Nintendo;
Remove custom html from markdown, clean-up UI (again)

Signed-off-by: Paul W. <lambdapaul@protonmail.com>
2024-02-13 18:01:07 -05:00

32 lines
861 B
TypeScript

import Link from "next/link";
import NotesInfo from '../public/notes.json';
function RecentNotes() {
const notes = Object.entries(NotesInfo).reverse();
return (
<ul className='block'>
<h2>Recent Notes</h2>
{notes?.slice(0, 5)
.map(([slug, note]: any, i: number) => {
return (
<li
key={i}
>
<Link
href={`/notes/${slug}`}>
{note.title}
</Link>
</li>
);
})
}
{
notes.length > 5 &&
<Link href='/notes'>More...</Link>
}
</ul>
);
}
export default RecentNotes;