From 94080973e680a4db135ddfa73cb4f2ae00f3488e Mon Sep 17 00:00:00 2001 From: bender Date: Mon, 9 Mar 2026 08:26:54 +0000 Subject: [PATCH] Switch to version 1: modified src/components/sections/testimonial/TestimonialCardSixteen.tsx --- .../testimonial/TestimonialCardSixteen.tsx | 258 ++++++++++++++++-- 1 file changed, 235 insertions(+), 23 deletions(-) diff --git a/src/components/sections/testimonial/TestimonialCardSixteen.tsx b/src/components/sections/testimonial/TestimonialCardSixteen.tsx index 9e177c7..5ac4e20 100644 --- a/src/components/sections/testimonial/TestimonialCardSixteen.tsx +++ b/src/components/sections/testimonial/TestimonialCardSixteen.tsx @@ -1,28 +1,240 @@ -import React from "react"; -import { CardStack } from "@/components/cardStack/CardStack"; +"use client"; + +import { memo } from "react"; +import CardStack from "@/components/cardStack/CardStack"; +import MediaContent from "@/components/shared/MediaContent"; +import { cls } from "@/lib/utils"; +import { Star } from "lucide-react"; +import type { LucideIcon } from "lucide-react"; +import type { ButtonConfig, ButtonAnimationType, CardAnimationTypeWith3D, TitleSegment, TextboxLayout, InvertedBackground } from "@/components/cardStack/types"; + +type Testimonial = { + id: string; + name: string; + role: string; + company: string; + rating: number; + imageSrc?: string; + videoSrc?: string; + imageAlt?: string; + videoAriaLabel?: string; +}; + +type KpiItem = { + value: string; + label: string; +}; interface TestimonialCardSixteenProps { - testimonials?: any[]; - title?: string; - description?: string; - animationType?: string; - textboxLayout?: string; - useInvertedBackground?: boolean; + testimonials: Testimonial[]; + kpiItems: [KpiItem, KpiItem, KpiItem]; + carouselMode?: "auto" | "buttons"; + uniformGridCustomHeightClasses?: string; + animationType: CardAnimationTypeWith3D; + title: string; + titleSegments?: TitleSegment[]; + description: string; + tag?: string; + tagIcon?: LucideIcon; + tagAnimation?: ButtonAnimationType; + buttons?: ButtonConfig[]; + buttonAnimation?: ButtonAnimationType; + textboxLayout: TextboxLayout; + useInvertedBackground: InvertedBackground; + ariaLabel?: string; + className?: string; + containerClassName?: string; + cardClassName?: string; + textBoxTitleClassName?: string; + textBoxTitleImageWrapperClassName?: string; + textBoxTitleImageClassName?: string; + textBoxDescriptionClassName?: string; + imageClassName?: string; + overlayClassName?: string; + ratingClassName?: string; + nameClassName?: string; + roleClassName?: string; + companyClassName?: string; + gridClassName?: string; + carouselClassName?: string; + controlsClassName?: string; + textBoxClassName?: string; + textBoxTagClassName?: string; + textBoxButtonContainerClassName?: string; + textBoxButtonClassName?: string; + textBoxButtonTextClassName?: string; } -export default function TestimonialCardSixteen({ - testimonials = [], - title = "Testimonials", description = "What customers say", animationType = "slide-up", textboxLayout = "default", useInvertedBackground = false, -}: TestimonialCardSixteenProps) { - const items = testimonials.map((testimonial) => ({ - id: testimonial.id, - label: testimonial.name, - detail: testimonial.company, - })); - - return ( -
- -
- ); +interface TestimonialCardProps { + testimonial: Testimonial; + cardClassName?: string; + imageClassName?: string; + overlayClassName?: string; + ratingClassName?: string; + nameClassName?: string; + roleClassName?: string; + companyClassName?: string; } + +const TestimonialCard = memo(({ + testimonial, + cardClassName = "", + imageClassName = "", + overlayClassName = "", + ratingClassName = "", + nameClassName = "", + roleClassName = "", + companyClassName = "", +}: TestimonialCardProps) => { + return ( +
+ + +
+
+ {Array.from({ length: 5 }).map((_, index) => ( + + ))} +
+ +

+ {testimonial.name} +

+ +
+

+ {testimonial.role} +

+

+ {testimonial.company} +

+
+
+
+ ); +}); + +TestimonialCard.displayName = "TestimonialCard"; + +const TestimonialCardSixteen = ({ + testimonials, + kpiItems, + carouselMode = "buttons", + uniformGridCustomHeightClasses = "min-h-none", + animationType, + title, + titleSegments, + description, + tag, + tagIcon, + tagAnimation, + buttons, + buttonAnimation, + textboxLayout, + useInvertedBackground, + ariaLabel = "Testimonials section", + className = "", + containerClassName = "", + cardClassName = "", + textBoxTitleClassName = "", + textBoxTitleImageWrapperClassName = "", + textBoxTitleImageClassName = "", + textBoxDescriptionClassName = "", + imageClassName = "", + overlayClassName = "", + ratingClassName = "", + nameClassName = "", + roleClassName = "", + companyClassName = "", + gridClassName = "", + carouselClassName = "", + controlsClassName = "", + textBoxClassName = "", + textBoxTagClassName = "", + textBoxButtonContainerClassName = "", + textBoxButtonClassName = "", + textBoxButtonTextClassName = "", +}: TestimonialCardSixteenProps) => { + const kpiSection = ( +
+ {kpiItems.map((item, index) => ( +
+
+

{item.value}

+

{item.label}

+
+ {index < 2 && ( +
+ )} +
+ ))} +
+ ); + + return ( + + {testimonials.map((testimonial, index) => ( + + ))} + + ); +}; + +TestimonialCardSixteen.displayName = "TestimonialCardSixteen"; + +export default TestimonialCardSixteen;