"use client"; import { useState } from "react"; import { ChevronDown } from "lucide-react"; import { cn } from "@/lib/utils"; export interface FaqAccordionItem { id: string; question: string; answer: string; } /** * Interactive accordion. Items are passed in from the server so the full * question + answer text is present in the initial HTML (indexable), while the * open/close behaviour is hydrated on the client. */ export function FaqAccordion({ items }: { items: FaqAccordionItem[] }) { const [openIndex, setOpenIndex] = useState(null); return (
{items.map((item, i) => { const isOpen = openIndex === i; return (

{item.answer}

); })}
); }