From a8e8fc73498e85c0cc1692b7330aeb3567f4a1e6 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Thu, 16 Dec 2021 19:30:32 +0100
Subject: chore: display year between blog posts

---
 src/components/PostPreview/PostPreview.tsx | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

(limited to 'src/components/PostPreview/PostPreview.tsx')

diff --git a/src/components/PostPreview/PostPreview.tsx b/src/components/PostPreview/PostPreview.tsx
index 8f3e0da..3dfef73 100644
--- a/src/components/PostPreview/PostPreview.tsx
+++ b/src/components/PostPreview/PostPreview.tsx
@@ -6,13 +6,17 @@ import ArrowRightIcon from '@assets/images/icon-arrow-right.svg';
 import styles from './PostPreview.module.scss';
 import Image from 'next/image';
 
+type TitleLevel = 2 | 3 | 4 | 5 | 6;
+
 const PostPreview = ({
   post,
-  TitleTag,
+  titleLevel,
 }: {
   post: ArticlePreview;
-  TitleTag: keyof JSX.IntrinsicElements;
+  titleLevel: TitleLevel;
 }) => {
+  const TitleTag = `h${titleLevel}` as keyof JSX.IntrinsicElements;
+
   return (
     <article className={styles.wrapper}>
       {post.featuredImage && (
-- 
cgit v1.2.3

