import PostMeta from '@components/PostMeta/PostMeta'; import { t } from '@lingui/macro'; import { ArticleMeta, ArticlePreview } from '@ts/types/articles'; import Link from 'next/link'; import styles from './PostPreview.module.scss'; import Image from 'next/image'; import { ButtonLink } from '@components/Buttons'; import { ArrowIcon } from '@components/Icons'; import { TitleLevel } from '@ts/types/app'; const PostPreview = ({ post, titleLevel, }: { post: ArticlePreview; titleLevel: TitleLevel; }) => { const TitleTag = `h${titleLevel}` as keyof JSX.IntrinsicElements; const meta: ArticleMeta = { commentCount: post.commentCount ? post.commentCount : 0, dates: post.dates, subjects: post.subjects, thematics: post.thematics, }; return (
{post.featuredImage && Object.keys(post.featuredImage).length > 0 && (
{post.featuredImage.altText}
)}
{post.title}
); }; export default PostPreview;