1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
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';
type TitleLevel = 2 | 3 | 4 | 5 | 6;
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 (