import React from "react"; import { TestimonialCard } from "./TestimonialCard"; import { motion } from "framer-motion"; import { Testimonial, TestimonialsProps } from "../../types"; import { cn } from "../../lib/utils"; interface ScrollLayoutProps extends Omit { testimonials: Omit[]; } export function ScrollLayout({ testimonials, theme = "light", className, }: ScrollLayoutProps) { // Duplicate testimonials for seamless looping const items = [...testimonials, ...testimonials]; // Approximate card width (Tailwind w-72/80/96 ≈ ~288–384px) const SPEED = 100; const CARD_WIDTH = 320; const totalWidth = CARD_WIDTH * testimonials.length + 24 * testimonials.length; // card + gap return (
{/* Gradient overlays */}
{/* Scrolling container */} {items.map((testimonial, index) => (
))}
); }