diff --git a/src/components/ImageCarousel.astro b/src/components/ImageCarousel.astro index 175c74e..725f7cd 100644 --- a/src/components/ImageCarousel.astro +++ b/src/components/ImageCarousel.astro @@ -6,6 +6,7 @@ import { shuffleArray } from "@lib/utils"; interface Props { images: Array; + id?: string; class: string; altText?: string | ((index: number) => string); interval?: number; @@ -23,6 +24,7 @@ interface Props { const { images, + id = "carousel", class: className, altText = null, interval = 5000, @@ -38,8 +40,6 @@ const { shuffle = false } = Astro.props as Props; -const IDs: string[] = []; - const imagesArray = shuffle ? shuffleArray(images) : images; --- @@ -50,12 +50,9 @@ const imagesArray = shuffle ? shuffleArray(images) : images; { imagesArray.map((image, index) => { - const ID = `image-carousel-${Math.random().toString(36)}`; - IDs.push(ID); - return ( -