diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-action-detail.component.html b/ui-ngx/src/app/modules/home/components/ai/ai-action-detail.component.html
index cf6146bb64..6ccc83afcf 100644
--- a/ui-ngx/src/app/modules/home/components/ai/ai-action-detail.component.html
+++ b/ui-ngx/src/app/modules/home/components/ai/ai-action-detail.component.html
@@ -130,6 +130,18 @@
{{ say(block.text) }}
} diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-action-detail.models.ts b/ui-ngx/src/app/modules/home/components/ai/ai-action-detail.models.ts index f41f4e6b06..01bfb9783d 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-action-detail.models.ts +++ b/ui-ngx/src/app/modules/home/components/ai/ai-action-detail.models.ts @@ -83,7 +83,13 @@ export type AiDetailBlock = | {type: 'code'; label: string; text: string} | {type: 'note'; text: AiDetailText} | {type: 'text'; text: string} - | {type: 'json'; label: string; text: string}; + | {type: 'json'; label: string; text: string} + | {type: 'images'; rows: AiDetailImage[]}; + +export interface AiDetailImage { + label?: AiDetailText; + url: string; +} export interface AiDetailView { hood?: AiDetailText; @@ -209,6 +215,16 @@ function entity(id: unknown, entityType: unknown, names: AiDetailNames): AiDetai return {id: key, entityType: type ?? known?.entityType, name: known?.name}; } +function galleryImage(value: unknown): string | undefined { + const url = str(value); + return url && /^(tb-image;)?\/api\/images\//.test(url) ? url : undefined; +} + +function images(rows: {label?: AiDetailText; value: unknown}[]): AiDetailBlock[] { + const found: AiDetailImage[] = rows.map(row => ({label: row.label, url: galleryImage(row.value)})).filter(row => !!row.url); + return found.length ? [{type: 'images', rows: found}] : []; +} + function text(key: string, params?: Record