summaryrefslogtreecommitdiffstats
path: root/src/components/PostPreview/PostPreview.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/PostPreview/PostPreview.tsx')
-rw-r--r--src/components/PostPreview/PostPreview.tsx15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/components/PostPreview/PostPreview.tsx b/src/components/PostPreview/PostPreview.tsx
index ccbb9e5..fa8bfd0 100644
--- a/src/components/PostPreview/PostPreview.tsx
+++ b/src/components/PostPreview/PostPreview.tsx
@@ -1,6 +1,6 @@
import PostMeta from '@components/PostMeta/PostMeta';
import { t } from '@lingui/macro';
-import { ArticlePreview } from '@ts/types/articles';
+import { ArticleMeta, ArticlePreview } from '@ts/types/articles';
import Link from 'next/link';
import styles from './PostPreview.module.scss';
import Image from 'next/image';
@@ -18,6 +18,12 @@ const PostPreview = ({
}) => {
const TitleTag = `h${titleLevel}` as keyof JSX.IntrinsicElements;
+ const meta: ArticleMeta = {
+ commentCount: post.commentCount ? post.commentCount : 0,
+ dates: post.dates,
+ thematics: post.thematics,
+ };
+
return (
<article className={styles.wrapper}>
{post.featuredImage && Object.keys(post.featuredImage).length > 0 && (
@@ -55,12 +61,7 @@ const PostPreview = ({
<ArrowIcon />
</ButtonLink>
</footer>
- <PostMeta
- commentCount={post.commentCount}
- publicationDate={post.dates.publication}
- updateDate={post.dates.update}
- thematics={post.thematics}
- />
+ <PostMeta meta={meta} />
</article>
);
};