import React, { useRef } from 'react';
import { useCardAnimation, UseCardAnimationOptions } from '@/hooks/useCardAnimation';

export interface AutoCarouselProps {
  children: React.ReactNode;
  title?: string;
  description?: string;
  textboxLayout?: string;
  animationType?: string;
  className?: string;
  carouselClassName?: string;
  containerClassName?: string;
  itemClassName?: string;
  ariaLabel?: string;
  showTextBox?: boolean;
  tag?: string;
  tagIcon?: any;
  tagAnimation?: string;
  buttons?: Array<{ text: string; onClick?: () => void; href?: string }>;
  buttonAnimation?: string;
  titleSegments?: Array<{ type: 'text'; content: string } | { type: 'image'; src: string; alt?: string }>;
}

export const AutoCarousel: React.FC<AutoCarouselProps> = ({
  children,
  containerClassName = '',
  ...props
}) => {
  const containerRef = useRef<HTMLDivElement>(null);
  const itemRefs = useRef<(HTMLDivElement | null)[]>([]);
  const bottomContentRef = useRef<HTMLDivElement>(null);

  const animationOptions: UseCardAnimationOptions = {
    containerRef,
    itemRefs,
    bottomContentRef,
  };

  const { } = useCardAnimation(animationOptions);

  return (
    <div ref={containerRef} className={containerClassName}>
      {children}
    </div>
  );
};

export default AutoCarousel;
