import ReviewCard1 from '@/components/cards/review-card-1'; import { Button } from '@/components/ui/button'; import { Carousel, type CarouselApi, CarouselContent, CarouselItem } from '@/components/ui/carousel'; import { getPageSection, getPropertyArray } from '@/lib/page'; import { cn } from '@/lib/utils'; import { IntroPageProps } from '@/types/page'; import { usePage } from '@inertiajs/react'; import Autoplay from 'embla-carousel-autoplay'; import { ChevronLeft, ChevronRight } from 'lucide-react'; import { useEffect, useState } from 'react'; import Section from '../section'; const Testimonials = () => { const { props } = usePage(); const { customize } = props; const [api, setApi] = useState(); const [currentSlide, setCurrentSlide] = useState(0); const testimonialsSection = getPageSection(props.page, 'testimonials'); useEffect(() => { if (!api) { return; } const handleSelect = () => { setCurrentSlide(api.selectedScrollSnap()); }; api.on('select', handleSelect); return () => { api.off('select', handleSelect); }; }, [api]); return (

{testimonialsSection?.title}

{testimonialsSection?.sub_title}

{testimonialsSection?.description}

{getPropertyArray(testimonialsSection).map((review, index) => (
))}
{api && getPropertyArray(testimonialsSection).map(({ id }, index) => (
api.scrollTo(index)} >
))}
); }; export default Testimonials;