From 1de59aba84a0b4b71118583a247faa950a2eb3e7 Mon Sep 17 00:00:00 2001 From: achmad Date: Thu, 28 May 2026 22:29:36 +0700 Subject: [PATCH] feat: HeroSection component --- components/home/HeroSection.tsx | 61 +++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 components/home/HeroSection.tsx diff --git a/components/home/HeroSection.tsx b/components/home/HeroSection.tsx new file mode 100644 index 0000000..9709a2e --- /dev/null +++ b/components/home/HeroSection.tsx @@ -0,0 +1,61 @@ +import Image from 'next/image' +import Link from 'next/link' +import { getAssetUrl } from '@/lib/directus' +import type { Article } from '@/lib/types' + +interface Props { + article: Article +} + +export default function HeroSection({ article }: Props) { + const href = `/${article.category.slug}/${article.slug}` + + return ( +
+
+
+ {article.featured_image ? ( + {article.title} + ) : ( +
+ )} +
+ +
+
+ + Featured + + + {article.category.name} + +
+ +

+ {article.title} +

+ + {article.excerpt && ( +

+ {article.excerpt} +

+ )} + + + Read article → + +
+
+
+ ) +}