diff options
| author | Armand Philippot <git@armandphilippot.com> | 2021-12-16 19:30:32 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2021-12-16 19:30:32 +0100 |
| commit | a8e8fc73498e85c0cc1692b7330aeb3567f4a1e6 (patch) | |
| tree | 02e92ea4d892c1128930327bc56c5123009bb365 /src/components/PostPreview/PostPreview.tsx | |
| parent | 9a81ce60575403d5d3fc489f9b51d85e7108344b (diff) | |
chore: display year between blog posts
Diffstat (limited to 'src/components/PostPreview/PostPreview.tsx')
| -rw-r--r-- | src/components/PostPreview/PostPreview.tsx | 8 |
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 && ( |
