2022-04-28 16:37:12 +00:00
|
|
|
import Link from "next/link";
|
2023-10-30 04:18:38 +00:00
|
|
|
import NotesInfo from '../public/notes.json';
|
2022-04-28 16:37:12 +00:00
|
|
|
|
2023-10-30 04:18:38 +00:00
|
|
|
function RecentNotes() {
|
|
|
|
const notes = Object.entries(NotesInfo);
|
2022-05-15 13:56:45 +00:00
|
|
|
return (
|
|
|
|
<div className='block'>
|
|
|
|
<div className='h2'>Recent Notes</div>
|
2023-10-30 04:18:38 +00:00
|
|
|
{notes?.slice(0, 10)
|
|
|
|
.map(([slug, note]: any) => {
|
|
|
|
return <Link key={slug} href={`/notes/${slug}`} className={`button link`}>{note.title}</Link>
|
2022-05-15 13:56:45 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
{
|
2023-10-30 04:18:38 +00:00
|
|
|
notes.length > 10 &&
|
2022-10-05 03:41:59 +00:00
|
|
|
<div>
|
2023-09-20 04:25:34 +00:00
|
|
|
<Link href='/notes' className='h5'>More...</Link>
|
2022-05-15 13:56:45 +00:00
|
|
|
</div>
|
|
|
|
}
|
|
|
|
</div>
|
2022-04-28 16:37:12 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-09-20 04:25:34 +00:00
|
|
|
export default RecentNotes;
|