"use client";
import { useState } from "react";
import { ArrowLeft, ArrowRight } from "lucide-react";
import CardStackTextBox from "@/components/cardStack/CardStackTextBox";
import MediaContent from "@/components/shared/MediaContent";
import AnimationContainer from "@/components/sections/AnimationContainer";
import { cls, shouldUseInvertedText } from "@/lib/utils";
import { useTheme } from "@/providers/themeProvider/ThemeProvider";
import type { LucideIcon } from "lucide-react";
import type { ButtonConfig, TitleSegment } from "@/components/cardStack/types";
import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants";
interface Testimonial {
id: string;
title: string;
quote: string;
name: string;
role: string;
imageSrc?: string;
videoSrc?: string;
imageAlt?: string;
videoAriaLabel?: string;
}
interface TestimonialCardTenProps {
testimonials: Testimonial[];
title: string;
titleSegments?: TitleSegment[];
description: string;
tag?: string;
tagIcon?: LucideIcon;
buttons?: ButtonConfig[];
textboxLayout: TextboxLayout;
useInvertedBackground: InvertedBackground;
ariaLabel?: string;
className?: string;
containerClassName?: string;
textBoxTitleClassName?: string;
textBoxDescriptionClassName?: string;
textBoxClassName?: string;
textBoxTagClassName?: string;
textBoxButtonContainerClassName?: string;
textBoxButtonClassName?: string;
textBoxButtonTextClassName?: string;
titleImageWrapperClassName?: string;
titleImageClassName?: string;
contentClassName?: string;
quoteCardClassName?: string;
testimonialTitleClassName?: string;
quoteClassName?: string;
nameClassName?: string;
roleClassName?: string;
navigationClassName?: string;
navigationButtonClassName?: string;
mediaCardClassName?: string;
mediaClassName?: string;
}
const TestimonialCardTen = ({
testimonials,
title,
titleSegments,
description,
tag,
tagIcon,
buttons,
textboxLayout,
useInvertedBackground,
ariaLabel = "Testimonials section",
className = "",
containerClassName = "",
textBoxTitleClassName = "",
textBoxDescriptionClassName = "",
textBoxClassName = "",
textBoxTagClassName = "",
textBoxButtonContainerClassName = "",
textBoxButtonClassName = "",
textBoxButtonTextClassName = "",
titleImageWrapperClassName = "",
titleImageClassName = "",
contentClassName = "",
quoteCardClassName = "",
testimonialTitleClassName = "",
quoteClassName = "",
nameClassName = "",
roleClassName = "",
navigationClassName = "",
navigationButtonClassName = "",
mediaCardClassName = "",
mediaClassName = "",
}: TestimonialCardTenProps) => {
const [activeIndex, setActiveIndex] = useState(0);
const theme = useTheme();
const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle);
const handlePrev = () => {
setActiveIndex((prev) => (prev === 0 ? testimonials.length - 1 : prev - 1));
};
const handleNext = () => {
setActiveIndex((prev) => (prev === testimonials.length - 1 ? 0 : prev + 1));
};
const activeTestimonial = testimonials[activeIndex];
return (
{activeTestimonial.title}
“{activeTestimonial.quote}”
{activeTestimonial.name}
{activeTestimonial.role}
);
};
TestimonialCardTen.displayName = "TestimonialCardTen";
export default TestimonialCardTen;