import { useState, useEffect, useCallback } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { Star, ChevronLeft, ChevronRight, Quote } from 'lucide-react'; import { Button } from '@/components/ui/button'; import useEmblaCarousel from 'embla-carousel-react'; import Autoplay from 'embla-carousel-autoplay'; import { useReviews } from '@/hooks/queires/useReviews'; const testimonials = [ { id: 1, name: 'Jennifer Martinez', role: 'CEO, InnovateTech', avatar: 'https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=150&h=150&fit=crop&crop=face', rating: 5, quote: 'TechZaa transformed our entire digital infrastructure. Their AI solutions increased our operational efficiency by 40%. Absolutely incredible team to work with!', }, { id: 2, name: 'Michael Chen', role: 'CTO, FutureScale', avatar: 'https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=150&h=150&fit=crop&crop=face', rating: 5, quote: 'The mobile app they developed for us exceeded all expectations. User engagement increased by 200% within the first month. Highly recommend their services.', }, { id: 3, name: 'Sarah Thompson', role: 'Director of Operations, CloudFirst', avatar: 'https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=150&h=150&fit=crop&crop=face', rating: 5, quote: 'Their cloud migration expertise saved us countless hours and reduced our infrastructure costs by 35%. Professional, efficient, and always available.', }, { id: 4, name: 'David Rodriguez', role: 'Founder, StartupLabs', avatar: 'https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=150&h=150&fit=crop&crop=face', rating: 5, quote: 'From concept to launch, TechZaa was with us every step. Their attention to detail and innovative approach made our product stand out in a crowded market.', }, { id: 5, name: 'Emily Watson', role: 'VP Engineering, DataFlow', avatar: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=150&h=150&fit=crop&crop=face', rating: 5, quote: 'The best tech partner we\'ve ever worked with. Their team understood our vision and delivered a solution that perfectly aligned with our business goals.', }, ]; export default function TestimonialsSection() { const {data: reveiwsData} = useReviews(); const testimonials = reveiwsData?.data.data; const [emblaRef, emblaApi] = useEmblaCarousel( { loop: true, align: 'center' }, [Autoplay({ delay: 5000, stopOnInteraction: false })] ); const [selectedIndex, setSelectedIndex] = useState(0); const scrollPrev = useCallback(() => emblaApi?.scrollPrev(), [emblaApi]); const scrollNext = useCallback(() => emblaApi?.scrollNext(), [emblaApi]); const onSelect = useCallback(() => { if (!emblaApi) return; setSelectedIndex(emblaApi.selectedScrollSnap()); }, [emblaApi]); useEffect(() => { if (!emblaApi) return; onSelect(); emblaApi.on('select', onSelect); return () => { emblaApi.off('select', onSelect); }; }, [emblaApi, onSelect]); return (
{/* Background */}
{/* Section Header */} Client Stories

What Our Clients Say

Don't just take our word for it - hear from the amazing companies we've had the pleasure of working with.

{/* Carousel */}
{/* Navigation Buttons */} {/* Carousel Container */}
{testimonials?.map((testimonial, index) => (
{/* Quote Icon */}
{/* Stars */}
{[...Array(testimonial.rating)]?.map((_, i) => ( ))}
{/* Quote */}

"{testimonial.review}"

{/* Author */}
{testimonial.client_name}

{testimonial.client_name}

{testimonial.designation}

))}
{/* Dots Indicator */}
{testimonials?.map((_, index) => (
); }