(index: number)
| 32 | |
| 33 | // 6. Define the 'handleImageLoad' function to update the 'loadedImages' state when an image is loaded |
| 34 | const handleImageLoad = (index: number) => { |
| 35 | setLoadedImages((prevLoadedImages) => { |
| 36 | const updatedLoadedImages = [...prevLoadedImages]; |
| 37 | updatedLoadedImages[index] = true; |
| 38 | return updatedLoadedImages; |
| 39 | }); |
| 40 | }; |
| 41 | |
| 42 | // 7. Define the 'handleVideoSelect' function to set the 'selectedVideo' state when a thumbnail is clicked |
| 43 | const handleVideoSelect = (link: string) => { |