import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@/components/ui/accordion'; import { getPageSection, getPropertyArray } from '@/lib/page'; import { IntroPageProps } from '@/types/page'; import { usePage } from '@inertiajs/react'; import Section from '../section'; const FAQs = () => { const { props } = usePage(); const { page, customize } = props; const faqsCoursesSection = getPageSection(page, 'faqs'); const array = getPropertyArray(faqsCoursesSection); const midPoint = Math.floor(array.length / 2); const firstPart = array.slice(0, midPoint); const secondPart = array.slice(midPoint); return (

{faqsCoursesSection?.title}

{faqsCoursesSection?.description}

{firstPart.map((faq, index) => ( {faq.title} {faq.description} ))}
{secondPart.map((faq, index) => ( {faq.title} {faq.description} ))}
); }; export default FAQs;