"use client"; import { motion, useInView } from "framer-motion"; import { useRef, useState } from "react"; import { SectionHeader } from "@/components/shared/SectionHeader"; import { testimonials } from "@/lib/constants"; function TestimonialCard({ testimonial, index, }: { testimonial: (typeof testimonials)[0]; index: number; }) { const ref = useRef(null); const isInView = useInView(ref, { once: true, margin: "-50px" }); return ( {Array.from({ length: testimonial.rating }).map((_, i) => ( ★ ))} “{testimonial.quote}” {testimonial.flag} {testimonial.name} {testimonial.type} ); } export function Testimonials() { const [showAll, setShowAll] = useState(false); const displayed = showAll ? testimonials : testimonials.slice(0, 3); return ( {displayed.map((t, i) => ( ))} {!showAll && testimonials.length > 3 && ( setShowAll(true)} className="text-bosphorus font-semibold text-sm hover:underline" > Show all {testimonials.length} reviews → )} ); }
“{testimonial.quote}”
{testimonial.name}
{testimonial.type}