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.tsx8
1 files changed, 6 insertions, 2 deletions
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 && (