"use client" import { useMemo, useState } from "react" import { Card, CardContent } from "@/components/ui/card" import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" import { Button } from "@/components/ui/button" import { ChevronLeft, ChevronRight, Quote } from "lucide-react" import { motion, AnimatePresence } from "framer-motion" import { useWindowSize } from "@uidotdev/usehooks" import { Animate } from "@/components/animations/animate" interface Testimonial { quote: string; author: string; role: string; avatar: string; } const testimonials: Testimonial[] = [ // { // quote: // "Working with TECHTONIC FAULT was a game-changer for our business. They delivered a custom e-commerce solution that increased our online sales by 40% in the first quarter.", // author: "Sarah Johnson", // role: "CEO, FashionForward", // avatar: "/placeholder.svg?height=40&width=40", // }, // { // quote: // "The team at TECHTONIC FAULT understood our complex requirements and delivered a solution that exceeded our expectations. Their attention to detail and commitment to quality is unmatched.", // author: "Michael Chen", // role: "CTO, HealthTech Solutions", // avatar: "/placeholder.svg?height=40&width=40", // }, // { // quote: // "We've worked with several development firms in the past, but none have matched the level of expertise and dedication that TECHTONIC FAULT brings to the table.", // author: "Jessica Williams", // role: "Product Manager, FinanceApp", // avatar: "/placeholder.svg?height=40&width=40", // }, // { // quote: // "The mobile app TECHTONIC FAULT developed for us has transformed how we engage with our customers. User-friendly, reliable, and exactly what we needed.", // author: "David Rodriguez", // role: "Marketing Director, TravelEase", // avatar: "/placeholder.svg?height=40&width=40", // }, // { // quote: // "From concept to deployment, TECHTONIC FAULT guided us through every step of the process with professionalism and expertise. I couldn't recommend them more highly.", // author: "Emily Thompson", // role: "Founder, EdTech Innovations", // avatar: "/placeholder.svg?height=40&width=40", // }, ] export function TestimonialsSection() { if (!testimonials.length) return <>; return (

Dicono di noi

Ecco cosa hanno da dire i clienti che hanno lavorato di noi.

); } export function Testimonials() { const [currentIndex, setCurrentIndex] = useState(0) const size = useWindowSize(); const displayCount = useMemo(() => { if (typeof window !== "undefined") { if (window.innerWidth >= 1024) return 3 if (window.innerWidth >= 768) return 2 return 1 } return 1 }, [size.width]); const handlePrev = () => { console.log(currentIndex, (currentIndex === 0 ? testimonials.length - displayCount : currentIndex - 1)); setCurrentIndex((prevIndex) => (prevIndex === 0 ? testimonials.length - displayCount : prevIndex - 1)) } const handleNext = () => { console.log(currentIndex, (currentIndex + 1) % (testimonials.length - displayCount + 1)); setCurrentIndex((prevIndex) => (prevIndex + 1) % (testimonials.length - displayCount + 1)) } const visibleTestimonials = testimonials.slice(currentIndex, currentIndex + displayCount) return (
{visibleTestimonials.map((testimonial, index) => (

{testimonial.quote}

{testimonial.author .split(" ") .map((n) => n[0]) .join("")}

{testimonial.author}{currentIndex + index}

{testimonial.role}

))}
) }