www/components/recent-notes.tsx
Paul W. 35d56f5cde
Bump script ver and refactor md metadata gen
Signed-off-by: Paul W. <lambdapaul@protonmail.com>
2023-10-30 00:18:38 -04:00

25 lines
702 B
TypeScript

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