diff --git a/src/components/cardStack/layouts/carousels/AutoCarousel.tsx b/src/components/cardStack/layouts/carousels/AutoCarousel.tsx index beb11d3..85ad98e 100644 --- a/src/components/cardStack/layouts/carousels/AutoCarousel.tsx +++ b/src/components/cardStack/layouts/carousels/AutoCarousel.tsx @@ -1,25 +1,148 @@ -import { ReactNode } from 'react'; -import { useCardStack } from '../../CardStackContext'; +"use client"; -export interface AutoCarouselProps { - children: ReactNode; - className?: string; - ariaLabel?: string; -} +import { memo, Children } from "react"; +import Marquee from "react-fast-marquee"; +import CardStackTextBox from "../../CardStackTextBox"; +import { cls } from "@/lib/utils"; +import { AutoCarouselProps } from "../../types"; +import { useCardAnimation } from "../../hooks/useCardAnimation"; -export function AutoCarousel({ children, className = '', ariaLabel = 'Auto carousel' }: AutoCarouselProps) { - const { isVisible, getAnimationProps } = useCardStack(); - const animationProps = getAnimationProps(); +const AutoCarousel = ({ + children, + uniformGridCustomHeightClasses, + animationType, + speed = 50, + title, + titleSegments, + description, + tag, + tagIcon, + tagAnimation, + buttons, + buttonAnimation, + textboxLayout = "default", + useInvertedBackground, + bottomContent, + className = "", + containerClassName = "", + carouselClassName = "", + itemClassName = "", + textBoxClassName = "", + titleClassName = "", + titleImageWrapperClassName = "", + titleImageClassName = "", + descriptionClassName = "", + tagClassName = "", + buttonContainerClassName = "", + buttonClassName = "", + buttonTextClassName = "", + ariaLabel, + showTextBox = true, + dualMarquee = false, + topMarqueeDirection = "left", + bottomCarouselClassName = "", + marqueeGapClassName = "", +}: AutoCarouselProps) => { + const childrenArray = Children.toArray(children); + const heightClasses = uniformGridCustomHeightClasses || "min-h-80 2xl:min-h-90"; + const { itemRefs, bottomContentRef } = useCardAnimation({ + animationType, + itemCount: childrenArray.length, + isGrid: false + }); - return ( -