import { MessageCircle } from 'lucide-react';
import Link from 'next/link';

import { Container, Section, SectionHeading } from '@/components/layout/container';
import { FaqAccordion } from '@/components/marketing/faq-accordion';
import { Reveal } from '@/components/motion/reveal';
import { buttonVariants } from '@/components/ui/button';
import { faqs } from '@/lib/marketing';
import { cn } from '@/lib/utils';

export function FaqSection({ items = faqs, muted = false }: { items?: typeof faqs; muted?: boolean }) {
  return (
    <Section id="faq" muted={muted} className="scroll-mt-20">
      <Container className="grid gap-10 lg:grid-cols-12 lg:gap-12">
        <Reveal className="lg:col-span-5">
          <div className="lg:sticky lg:top-28">
            <SectionHeading
              align="left"
              eyebrow="FAQ"
              title="Questions, answered"
              text="Straight answers about wallets, rates, cancellations and tracking. Still stuck? Our team is happy to help."
            />
            <Link href="/contact" className={cn(buttonVariants({ variant: 'secondary', size: 'lg' }), 'mt-8')}>
              <MessageCircle className="h-4 w-4 text-primary" aria-hidden="true" />
              Contact support
            </Link>
          </div>
        </Reveal>
        <Reveal index={1} className="lg:col-span-7">
          <FaqAccordion items={items} />
        </Reveal>
      </Container>
    </Section>
  );
}
