MCPcopy
hub / github.com/github/awesome-copilot / getGalleryImages

Function getGalleryImages

website/src/scripts/pages/extensions.ts:94–114  ·  view source on GitHub ↗
(item: Extension)

Source from the content-addressed store, hash-verified

92}
93
94function 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
116function renderGalleryThumbnails(images: string[], selectedUrl: string): void {
117 const gallery = document.getElementById("extension-details-gallery");

Callers 1

openDetailsModalFunction · 0.85

Calls 2

toRawAssetUrlFunction · 0.85

Tested by

no test coverage detected