diff --git a/src/components/sections/faq/FaqTwoColumn.tsx b/src/components/sections/faq/FaqTwoColumn.tsx index 3574668..e69de29 100644 --- a/src/components/sections/faq/FaqTwoColumn.tsx +++ b/src/components/sections/faq/FaqTwoColumn.tsx @@ -1,122 +0,0 @@ -import { useState } from "react"; -import { motion, AnimatePresence } from "motion/react"; -import { Plus } from "lucide-react"; -import ScrollReveal from "@/components/ui/ScrollReveal"; -import Button from "@/components/ui/Button"; -import TextAnimation from "@/components/ui/TextAnimation"; -import { cls } from "@/lib/utils"; - -type FaqItem = { - question: string; - answer: string; -}; - -const FaqTwoColumn = ({ - tag, - title, - description, - primaryButton, - secondaryButton, - items, -}: { - tag: string; - title: string; - description: string; - primaryButton?: { text: string; href: string }; - secondaryButton?: { text: string; href: string }; - items: FaqItem[]; -}) => { - const [activeIndex, setActiveIndex] = useState(null); - - const handleToggle = (index: number) => { - setActiveIndex(activeIndex === index ? null : index); - }; - - const halfLength = Math.ceil(items.length / 2); - const firstColumn = items.slice(0, halfLength); - const secondColumn = items.slice(halfLength); - - const renderAccordionItem = (item: FaqItem, index: number) => ( -
handleToggle(index)} - className="p-3 xl:p-3.5 2xl:p-4 rounded card cursor-pointer select-none" - > -
-

{item.question}

-
- -
-
- - {activeIndex === index && ( - -

{item.answer}

-
- )} -
-
- ); - - return ( -
-
-
-
-

{tag}

-
- - - - - - {(primaryButton || secondaryButton) && ( -
- {primaryButton &&
- )} -
- - -
-
- {firstColumn.map((item, index) => renderAccordionItem(item, index))} -
- {secondColumn.length > 0 && ( -
- {secondColumn.map((item, index) => renderAccordionItem(item, index + halfLength))} -
- )} -
-
-
-
- ); -}; - -export default FaqTwoColumn;