import React, { forwardRef, useState } from "react"; import { FAQSectionProps } from "../../types"; export const FAQSection = forwardRef( ( { className = "", title = "Frequently Asked Questions", subtitle = "Find answers to common questions about our component library", faqs = [ { question: "How do I install the component library?", answer: "You can install it via npm: `npm install agentc-starter-kit`. Then import the components you need in your React application.", }, { question: "Is TypeScript supported?", answer: "Yes! The library is built with TypeScript and includes full type definitions for all components.", }, { question: "Can I customize the styling?", answer: "Absolutely! All components use Tailwind CSS classes and support custom styling through className props and CSS variables.", }, { question: "What authentication providers are supported?", answer: "We support Google, Kakao, and Naver authentication out of the box, with easy integration for NextAuth.js.", }, { question: "Is there dark mode support?", answer: "Yes, all components support dark mode through CSS custom properties and Tailwind's dark mode utilities.", }, { question: "Do you provide documentation?", answer: "Yes, we provide comprehensive documentation with examples, API references, and usage guidelines for all components.", }, ], variant = "accordion", children, ...props }, ref ) => { const [openIndex, setOpenIndex] = useState(null); const toggleAccordion = (index: number) => { setOpenIndex(openIndex === index ? null : index); }; const renderAccordionFAQ = (faq: (typeof faqs)[0], index: number) => (

{faq.answer}

); const renderGridFAQ = (faq: (typeof faqs)[0], index: number) => (

{faq.question}

{faq.answer}

); return (

{title}

{subtitle && (

{subtitle}

)}
{faqs.map((faq, index) => variant === "grid" ? renderGridFAQ(faq, index) : renderAccordionFAQ(faq, index) )}
{children}
); } ); FAQSection.displayName = "FAQSection";