(item: Extension)
| 92 | } |
| 93 | |
| 94 | function getGalleryImages(item: Extension): string[] { |
| 95 | const images: string[] = []; |
| 96 | |
| 97 | if (item.imageUrl) { |
| 98 | images.push(item.imageUrl); |
| 99 | } |
| 100 | |
| 101 | const iconPath = item.screenshots?.icon?.path; |
| 102 | if (iconPath) { |
| 103 | const url = toRawAssetUrl(item, iconPath); |
| 104 | if (url) images.push(url); |
| 105 | } |
| 106 | |
| 107 | const galleryPaths = normalizeScreenshotEntries(item.screenshots?.gallery); |
| 108 | for (const entry of galleryPaths) { |
| 109 | const url = toRawAssetUrl(item, entry.path); |
| 110 | if (url) images.push(url); |
| 111 | } |
| 112 | |
| 113 | return Array.from(new Set(images)); |
| 114 | } |
| 115 | |
| 116 | function renderGalleryThumbnails(images: string[], selectedUrl: string): void { |
| 117 | const gallery = document.getElementById("extension-details-gallery"); |
no test coverage detected