import Link from 'next/link'; import React from 'react'; import Layout from '../../components/layout'; import Posts from '../../public/posts.json'; import prettyDatePrint from '../../util/pretty-date'; function HomePage({posts}: any) { Posts.sort((x, y) => { return x.title.localeCompare(y.title) }); // todo: create a table-like interface return ( <>
Post Name Created on Last Updated
{Posts.map((post: any) => { return
{post.title} {prettyDatePrint(new Date(post.created_at))} {post.last_updated ? {prettyDatePrint(new Date(post.last_updated))} : ''}
})}
) } export default HomePage;