AI store generator for ecommerce, Malaysia first. Laravel 13 + React + TypeScript.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import { Plus } from 'lucide-react';
  2. import { cn } from '@/lib/utils';
  3. import type { FaqSection } from '../types';
  4. import { Container, SectionHeading } from '../ui';
  5. export function Faq({ section }: { section: FaqSection }) {
  6. const { heading, items } = section.content;
  7. const twoColumn = section.variant === 'two-column';
  8. return (
  9. <section
  10. id={section.id}
  11. className="sf-section scroll-mt-20 py-16 md:py-20"
  12. >
  13. <Container
  14. className={cn(
  15. twoColumn
  16. ? 'grid gap-10 md:grid-cols-[1fr_2fr]'
  17. : 'max-w-3xl',
  18. )}
  19. >
  20. <SectionHeading heading={heading} />
  21. <div
  22. className={cn(
  23. 'divide-y divide-(--sf-border) border-y border-(--sf-border)',
  24. !twoColumn && 'mt-8',
  25. )}
  26. >
  27. {items.map((item) => (
  28. <details key={item.question} className="group py-5">
  29. <summary className="flex cursor-pointer list-none items-center justify-between gap-4 font-medium [&::-webkit-details-marker]:hidden">
  30. {item.question}
  31. <Plus
  32. aria-hidden
  33. className="size-4 shrink-0 text-(--sf-muted) transition-transform group-open:rotate-45"
  34. />
  35. </summary>
  36. <p className="mt-3 max-w-2xl leading-relaxed text-(--sf-muted)">
  37. {item.answer}
  38. </p>
  39. </details>
  40. ))}
  41. </div>
  42. </Container>
  43. </section>
  44. );
  45. }