MCPcopy
hub / github.com/directus/directus / getImageUrl

Function getImageUrl

app/src/ai/components/parts/file-ui-part-utils.ts:40–56  ·  view source on GitHub ↗
(item: PendingContextItem)

Source from the content-addressed store, hash-verified

38}
39
40export function getImageUrl(item: PendingContextItem): string | undefined {
41 if (!isImageFile(item)) return undefined;
42
43 if (isLocalFileContext(item)) {
44 return item.data.thumbnailUrl;
45 }
46
47 if (isFileContext(item)) {
48 if (item.data.type?.includes('svg')) {
49 return getAssetUrl(item.data.id);
50 }
51
52 return getAssetUrl(item.data.id, { key: 'system-small-cover' });
53 }
54
55 return undefined;
56}

Callers

nothing calls this directly

Calls 4

isLocalFileContextFunction · 0.90
isFileContextFunction · 0.90
getAssetUrlFunction · 0.90
isImageFileFunction · 0.85

Tested by

no test coverage detected