import { Image } from '@components/common/Image.js';
import React from 'react';
import Slider from 'react-slick';
import 'slick-carousel/slick/slick.css';
function PrevArrow(props: any) {
const { onClick } = props;
return (
);
}
function NextArrow(props: any) {
const { onClick } = props;
return (
);
}
function CustomDot(props: any) {
const { onClick, active, className } = props;
const isActive = active || (className && className.includes('active'));
return (
);
}
const SliderComponent = Slider as any;
interface SlideData {
id: string;
image: string;
width?: number; // Image natural width (automatically detected)
height?: number; // Image natural height (automatically detected)
headline?: string;
subText?: string;
buttonText?: string;
buttonLink?: string;
buttonColor?: string;
}
interface SlideshowProps {
slideshowWidget: {
slides: SlideData[];
autoplay?: boolean;
autoplaySpeed?: number;
arrows?: boolean;
dots?: boolean;
};
}
export default function Slideshow({
slideshowWidget: {
slides = [],
autoplay = true,
autoplaySpeed = 3000,
arrows = true,
dots = true
}
}: SlideshowProps) {
const settings = {
dots: false,
infinite: true,
speed: 500,
slidesToShow: 1,
slidesToScroll: 1,
autoplay: Boolean(autoplay),
autoplaySpeed: Number(autoplaySpeed) || 3000,
arrows: Boolean(arrows),
fade: false,
pauseOnHover: true,
adaptiveHeight: true,
nextArrow: arrows ?
{slide.subText}
)} {slide.buttonText && slide.buttonLink && ( {slide.buttonText} )}