import authors from 'lib/authors.json' import Image from 'next/image' import Link from 'next/link' import React from 'react' import Author from '~/types/author' import PostTypes from '~/types/post' import dayjs from 'dayjs' interface Props { post: PostTypes } const BlogGridItem = ({ post }: Props) => { const authorArray: string[] | undefined = post.author ? post.author.split(',') : [] const author = [] if (authorArray) { for (let i = 0; i < authorArray.length; i++) { author.push( authors.find((authors: Author) => { return authors.author_id === authorArray[i] }) ) } } return (
{dayjs(post.date).format('D MMM YYYY')}
{post.readingTime && ( <>•
{post.readingTime}
> )}{post.description}