diff --git a/src/components/sections/BlogPreviewSection.tsx b/src/components/sections/BlogPreviewSection.tsx new file mode 100644 index 0000000..b92d2a7 --- /dev/null +++ b/src/components/sections/BlogPreviewSection.tsx @@ -0,0 +1,75 @@ +'use client' + +import { useEmDashContent } from '@/hooks/useEmDashContent' +import Image from 'next/image' +import Link from 'next/link' + +export default function BlogPreviewSection() { + const { items, loading } = useEmDashContent('posts') + + if (loading) { + return ( +
+
+
+ ) + } + + if (items.length === 0) return null + + const posts = items.slice(0, 3) + + return ( +
+
+
+
+

The Thread

+

Latest Stories

+
+ + View all + +
+ +
+ {posts.map((post) => { + const d = post.data as { title?: string; excerpt?: string; image?: string; category?: string; author?: string } + return ( +
+
+ {d.image && ( + {d.title + )} +
+

{d.category || 'Style'}

+

+ {d.title} +

+

{d.excerpt}

+ + Read more + +
+ ) + })} +
+ +
+ + View all stories + +
+
+
+ ) +} \ No newline at end of file