import { clsx } from 'clsx'; import { GlowBg } from '@/components/shared/ui/glow-bg'; import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, } from '@/components/shared/ui/accordion'; export interface FaqItem { question: string; answer: string | React.ReactNode; } /** * A component meant to be used in the landing page. * It displays a collapsible list of frequently asked questions and their answers. */ export const LandingFaqCollapsibleSection = ({ className, title, titleComponent, description, descriptionComponent, faqItems, withBackground = false, withBackgroundGlow = false, variant = 'primary', backgroundGlowVariant = 'primary', }: { className?: string; title?: string | React.ReactNode; titleComponent?: React.ReactNode; description?: string | React.ReactNode; descriptionComponent?: React.ReactNode; faqItems: FaqItem[]; withBackground?: boolean; withBackgroundGlow?: boolean; variant?: 'primary' | 'secondary'; backgroundGlowVariant?: 'primary' | 'secondary'; }) => { return (
{withBackgroundGlow ? (
) : null}
{title ? (

{title}

) : ( titleComponent )} {description ? (

{description}

) : ( descriptionComponent )} {faqItems.map((faqItem, index) => ( {faqItem.question} {faqItem.answer} ))}
); };