(item: PendingContextItem)
| 38 | } |
| 39 | |
| 40 | export 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 | } |
nothing calls this directly
no test coverage detected