diff --git a/src/components/Wallet/VerticalSlide/index.tsx b/src/components/Wallet/VerticalSlide/index.tsx index 7ffef2d3..2871800f 100644 --- a/src/components/Wallet/VerticalSlide/index.tsx +++ b/src/components/Wallet/VerticalSlide/index.tsx @@ -9,11 +9,13 @@ import BracketRight from '@/public/images/Wallet/VerticalSlide/bracket-right.svg import layoutCss from '@/components/common/styles.module.css' import css from './styles.module.css' +const icons = [, , ] + const VerticalSlide = ({ title, items = [] }: BaseBlock) => { const [selectedIndex, setSelectedIndex] = useState(0) const itemsImages = items.map((item) => item.image) - const icons = [, , ] + const selectedImage = itemsImages[selectedIndex] const handleCardClick = (index: number) => { setSelectedIndex(index) @@ -46,9 +48,7 @@ const VerticalSlide = ({ title, items = [] }: BaseBlock) => { - {itemsImages[selectedIndex] ? ( - {itemsImages[selectedIndex].alt} - ) : null} + {selectedImage ? {selectedImage.alt} : null}