import Image from 'next/image' import Link from 'next/link' import AuthorAvatars from './AuthorAvatars' import authors from '@/lib/authors.json' import { BLOG_FEATURED_IMAGE_SIZES, BLOG_PLACEHOLDER_IMAGE, getBlogThumbnailImage, } from '@/lib/blog-images' import type PostTypes from '@/types/post' function FeaturedThumb(blog: PostTypes) { const authorArray = blog.author?.split(',').map((a) => a.trim()) || [] const author = [] for (let i = 0; i < authorArray.length; i++) { const foundAuthor = authors.find((authors: any) => { return authors.author_id === authorArray[i] }) if (foundAuthor) { author.push(foundAuthor) } } return renderFeaturedThumb(blog, author) } function renderFeaturedThumb(blog: PostTypes, author: any[]) { const imageUrl = getBlogThumbnailImage(blog) ?? BLOG_PLACEHOLDER_IMAGE return (
{/* Text */}

{blog.title}

{blog.description}

Author:
Published {blog.formattedDate} {blog.readingTime}
) } export default FeaturedThumb