package component type CarouselEntry struct { ImgPath string Title string Text string } func getEntry(arr []CarouselEntry, index int) CarouselEntry { newIndex := index for newIndex < 0 { newIndex += len(arr) } newIndex = newIndex % len(arr) return arr[newIndex] } templ Carousel(elm []CarouselEntry , index int) {
{getEntry(elm, index).Title}
{getEntry(elm, index).Text}