update: corrected version
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import React from 'react';
|
||||
import {
|
||||
Accordion,
|
||||
AccordionContent,
|
||||
AccordionItem,
|
||||
AccordionTrigger,
|
||||
} from "@/components/ui/accordion";
|
||||
import { motion } from 'framer-motion';
|
||||
|
||||
const FAQSection = ({ faqs }) => {
|
||||
return (
|
||||
<section className="service-section max-w-4xl mx-auto">
|
||||
<div className="text-center mb-12">
|
||||
<h2 className="service-heading">Frequently Asked Questions</h2>
|
||||
<div className="w-20 h-1 bg-primary mx-auto mb-6"></div>
|
||||
</div>
|
||||
|
||||
<motion.div
|
||||
initial={{ opacity: 0, y: 20 }}
|
||||
whileInView={{ opacity: 1, y: 0 }}
|
||||
viewport={{ once: true }}
|
||||
transition={{ duration: 0.6 }}
|
||||
>
|
||||
<Accordion type="single" collapsible className="w-full">
|
||||
{faqs.map((faq, index) => (
|
||||
<AccordionItem key={index} value={`item-${index}`} className="border-border">
|
||||
<AccordionTrigger className="text-left text-lg text-heading hover:text-primary font-medium px-4">
|
||||
{faq.question}
|
||||
</AccordionTrigger>
|
||||
<AccordionContent className="text-muted px-4 leading-relaxed text-base">
|
||||
{faq.answer}
|
||||
</AccordionContent>
|
||||
</AccordionItem>
|
||||
))}
|
||||
</Accordion>
|
||||
</motion.div>
|
||||
</section>
|
||||
);
|
||||
};
|
||||
|
||||
export default FAQSection;
|
||||
Reference in New Issue
Block a user