import React, { useState, useRef, useEffect } from 'react' import { cn } from '../utils' import { VscAdd, VscChromeMinimize } from "react-icons/vsc"; import { imageProps, } from '@/types'; import "slick-carousel/slick/slick.css"; import "slick-carousel/slick/slick-theme.css"; import Slider from "react-slick"; import './slick.css' interface CollapseProps { title: string children?: string className?: string info?: boolean info_images?: Array } const Collapse: React.FC = ({ title, children, className, info, info_images, }) => { const [currentSlide, setCurrentSlide] = useState(0); var settings2 = { arrows: false, infinite: true, //centerPadding: "30px", dots: true, speed: 500, slidesToShow: 3, slidesToScroll: 1, appendDots: (dots: any) => (
    {dots}
), dotsClass: 'dots_custom' }; var settings1 = { arrows: false, className: "center", centerMode: true, infinite: true, centerPadding: "30px", dots: true, speed: 500, slidesToShow: 1, slidesToScroll: 1, beforeChange: (current: number, next: number) => setCurrentSlide(next), appendDots: (dots: any) => (
    {dots}
), dotsClass: 'dots_custom' }; const [isOpen, setIsOpen] = useState(false) const [height, setHeight] = useState(0) const ref = useRef(null) useEffect(() => { if (isOpen) setHeight(ref.current?.scrollHeight) else setHeight(0) }, [isOpen]) return ( children && children.length > 0 ? (
{info ? (
{info_images && info_images.length > 0 && (
{info_images.map((image, index) => (
{`Course
))}
{/*
*/}
{info_images.map((image, index) => (
{`Course {index !== currentSlide && (
)}
))}
)}
) : (
)}
) : (
) ) } export default Collapse