diff --git a/src/components/sections/KnowBeforeYouGoSection.tsx b/src/components/sections/KnowBeforeYouGoSection.tsx new file mode 100644 index 0000000..7c3965f --- /dev/null +++ b/src/components/sections/KnowBeforeYouGoSection.tsx @@ -0,0 +1,63 @@ +'use client' + +import { useState } from 'react' +import { useEmDashContent } from '@/hooks/useEmDashContent' +import { ChevronDown, ChevronUp, Info } from 'lucide-react' + +export default function KnowBeforeYouGoSection() { + const { items, loading } = useEmDashContent('policies') + const [openIndex, setOpenIndex] = useState(null) + + if (loading) { + return ( +
+
+
+ ) + } + + if (items.length === 0) return null + + const toggle = (index: number) => { + setOpenIndex(prev => (prev === index ? null : index)) + } + + return ( +
+
+

Know before you go

+
+ {items.map((item, idx) => { + const d = item.data as { title?: string; description?: string; body?: string } + const content = d.description || d.body || '' + const isOpen = openIndex === idx + + return ( +
+ + {isOpen && ( +
+ {content || 'Details coming soon.'} +
+ )} +
+ ) + })} +
+
+
+ ) +}