diff --git a/src/components/sections/BotanicalWisdomSection.tsx b/src/components/sections/BotanicalWisdomSection.tsx new file mode 100644 index 0000000..887ee39 --- /dev/null +++ b/src/components/sections/BotanicalWisdomSection.tsx @@ -0,0 +1,46 @@ +'use client' +import { useState } from 'react'; +import { useVulaContent } from '@/hooks/useVulaContent' +import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/Card' +import Badge from '@/components/ui/Badge' +import Image from 'next/image' + +export default function BotanicalWisdomSection() { + const { items, loading } = useVulaContent('posts') + const [openIndex, setOpenIndex] = useState(-1) // hook before guard + if (loading) return
+ if (items.length === 0) return null + const posts = items.slice(0, 3) + return ( +
+
+
+

From our journal

+

Botanical Wisdom

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

{d.excerpt}

} + {d.author &&

By {d.author}

} +
+
+ ) + })} +
+
+
+ ) +} \ No newline at end of file