'use client' import React, { useState } from 'react' import { Plus, Minus } from 'lucide-react' import { AnimateIn } from '@/components/AnimateIn' interface FaqItem { question: string answer: string } interface FaqAccordionBlockProps { badge?: string heading: string subheading?: string items?: FaqItem[] } export function FaqAccordionBlockComponent(props: FaqAccordionBlockProps) { const { badge, heading, subheading, items } = props const [openIndex, setOpenIndex] = useState(0) const toggle = (idx: number) => { setOpenIndex(openIndex === idx ? null : idx) } return (
{badge && (
{badge}
)}

{heading}

{subheading && (

{subheading}

)}
{items && items.length > 0 && (
{items.map((item, idx) => { const isOpen = openIndex === idx return (
{isOpen && (
{item.answer}
)}
) })}
)}
) }