diff --git a/src/components/sections/StoriesOfTheLandSection.tsx b/src/components/sections/StoriesOfTheLandSection.tsx new file mode 100644 index 0000000..4d221bb --- /dev/null +++ b/src/components/sections/StoriesOfTheLandSection.tsx @@ -0,0 +1,104 @@ +'use client' + +import { useEmDashContent } from '@/hooks/useEmDashContent' +import Image from 'next/image' +import Link from 'next/link' +import { ArrowRight } from 'lucide-react' + +export default function StoriesOfTheLandSection() { + const { items, loading } = useEmDashContent('posts') + + if (loading) { + return ( +
+
+
+ ) + } + + // Filter for blog-tagged posts + const blogs = items.filter((item) => { + const d = item.data as { category?: string } + return d.category?.toLowerCase().includes('blog') + }) + + if (blogs.length === 0) return null + + return ( +
+
+
+ + From the Savanna + +

+ Stories of the Land +

+

+ Tales of nature, culture, and discovery from the heart of Kenya +

+
+ +
+ {blogs.slice(0, 6).map((item) => { + const d = item.data as { + title?: string + excerpt?: string + body?: string + author?: string + category?: string + image?: string + } + return ( +
+ {d.image && ( +
+ {d.title +
+ )} +
+
+ + {d.category} + + {d.author && ( + + by {d.author} + + )} +
+

+ {d.title} +

+

+ {d.excerpt || (d.body ? d.body.substring(0, 120) : '')} +

+ + Read More + +
+
+ ) + })} +
+
+
+ ) +}