'use client' import React, { useState } from 'react' import { motion, AnimatePresence } from 'framer-motion' import { ChevronDown } from 'lucide-react' import type { Page } from '../../payload-types' type Props = Extract[0], { blockType: 'faqTeaser' }> export const FAQTeaserBlock: React.FC = ({ title, questions }) => { const [openIndex, setOpenIndex] = useState(0) const toggleQuestion = (index: number) => { setOpenIndex(openIndex === index ? null : index) } return (

{title}

{questions?.map((q: NonNullable[0], index: number) => { const isOpen = openIndex === index return (
{isOpen && (
{q.answer}
)}
) })}
) }