[resumes][fix] Use date-fns to format upload time text

pull/326/head
Tan Su Yin 3 years ago
parent 359d9e1a16
commit 066cdd0ea4

@ -1,3 +1,4 @@
import { formatDistanceToNow } from 'date-fns';
import Link from 'next/link'; import Link from 'next/link';
import type { UrlObject } from 'url'; import type { UrlObject } from 'url';
import { ChevronRightIcon } from '@heroicons/react/20/solid'; import { ChevronRightIcon } from '@heroicons/react/20/solid';
@ -33,11 +34,11 @@ export default function BrowseListItem({ href, resumeInfo }: Props) {
</div> </div>
</div> </div>
</div> </div>
<div className="col-span-2 self-center text-sm text-slate-500"> <div className="col-span-3 self-center text-sm text-slate-500">
{/* TODO: Replace hardcoded days ago with calculated days ago*/} Uploaded {formatDistanceToNow(resumeInfo.createdAt)} ago by{' '}
Uploaded 2 days ago by {resumeInfo.user} {resumeInfo.user}
</div> </div>
<ChevronRightIcon className="col-span-2 w-8 self-center justify-self-center" /> <ChevronRightIcon className="col-span-1 w-8 self-center justify-self-center" />
</div> </div>
</Link> </Link>
); );

Loading…
Cancel
Save