import * as React from "react"
import { Plus } from "lucide-react"
import { cn } from "@/lib/utils"
import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
} from "@/components/ui/accordion"
type FaqItem = {
question: React.ReactNode
answer: React.ReactNode
}
/**
* Toggle disc: hairline teal plus that fills in and turns into an × once its
* item opens. Driven by the trigger's own `group`, so hovering the answer body
* below leaves the disc alone.
*/
function FaqIndicator() {
return (
)
}
/**
* FAQ list: one white card per question, plus disc as the toggle, and the open
* card tinted brand-50 behind a mint hairline so the answer reads as its own
* panel. Single-open and collapsible — the block only ever moves one card's
* worth of height, and every answer can be closed again.
*
* Sized for a reading column (centred `max-w-3xl`) instead of the full 6xl
* container; override the width via `className`.
*/
function FaqAccordion({
items,
defaultOpen = 0,
className,
}: {
items: FaqItem[]
/** index of the item open on first paint; `null` starts fully collapsed */
defaultOpen?: number | null
className?: string
}) {
return (
{items.map((item, i) => (
}
>
{item.question}
{item.answer}
))}
)
}
export { FaqAccordion }
export type { FaqItem }