ldc-bien-etre-animal/resources/ts/front/Components/ApproachCarousel.tsx
2026-09-07 16:45:41 +02:00

57 lines
1.4 KiB
TypeScript

import Carousel from "@/front/Components/Shared/Carousel";
import SliderCustomCard from "@/front/Components/Shared/SliderCustomCard";
import { cardType, type CardTypeName } from "@/front/lib/constants";
interface ApproachItem {
number: string;
title: string;
rotation?: number;
compactRotation?: number;
verso?: string;
ctaHref?: string;
ctaLabel?: string;
}
interface ApproachCarouselProps {
items: ApproachItem[];
controlsDotColor?: string;
controlsColor?: string;
type?: CardTypeName;
}
export default function ApproachCarousel({
items,
controlsDotColor,
controlsColor,
type = cardType.FLIP,
}: Readonly<ApproachCarouselProps>) {
return (
<div className="px-8 lg:py-24">
<Carousel
items={items}
initialIndex={0}
gap="gap-22"
showStar={false}
controlsColor={controlsColor}
controlsDotColor={controlsDotColor}
slotClassName="w-[290px] h-[410px]"
type="window"
windowSize={3}
renderItem={(item, index, isActive) => (
<SliderCustomCard
key={index}
number={item.number}
title={item.title}
verso={item.verso}
rotation={item.rotation}
compactRotation={item.compactRotation}
isActive={isActive}
type={type}
ctaHref={item.ctaHref}
ctaLabel={item.ctaLabel}
/>
)}
/>
</div>
);
}