@@ -6,7 +6,7 @@ import { cloneDeep } from 'lodash';
6
6
type Props = {
7
7
apiHost ?: string ;
8
8
chatflowid : string ;
9
- chatId : string
9
+ chatId : string ;
10
10
agentName : string ;
11
11
agentMessage : string ;
12
12
agentArtifacts ?: FileUpload [ ] ;
@@ -34,19 +34,19 @@ export const AgentReasoningBubble = (props: Props) => {
34
34
} ) ;
35
35
36
36
const agentReasoningArtifacts = ( artifacts : FileUpload [ ] ) => {
37
- const newArtifacts = cloneDeep ( artifacts )
37
+ const newArtifacts = cloneDeep ( artifacts ) ;
38
38
for ( let i = 0 ; i < newArtifacts . length ; i ++ ) {
39
- const artifact = newArtifacts [ i ]
40
- if ( artifact && ( artifact . type === 'png' || artifact . type === 'jpeg' ) ) {
41
- const data = artifact . data as string
42
- newArtifacts [ i ] . data = `${ props . apiHost } /api/v1/get-upload-file?chatflowId=${ props . chatflowid } &chatId=${ props . chatId } &fileName=${ data . replace (
43
- 'FILE-STORAGE::' ,
44
- ''
45
- ) } `
46
- }
39
+ const artifact = newArtifacts [ i ] ;
40
+ if ( artifact && ( artifact . type === 'png' || artifact . type === 'jpeg' ) ) {
41
+ const data = artifact . data as string ;
42
+ newArtifacts [ i ] . data = `${ props . apiHost } /api/v1/get-upload-file?chatflowId=${ props . chatflowid } &chatId=${ props . chatId } &fileName=${ data . replace (
43
+ 'FILE-STORAGE::' ,
44
+ '' ,
45
+ ) } `;
46
+ }
47
47
}
48
- return newArtifacts
49
- }
48
+ return newArtifacts ;
49
+ } ;
50
50
51
51
const renderArtifacts = ( item : Partial < FileUpload > ) => {
52
52
if ( item . type === 'png' || item . type === 'jpeg' ) {
@@ -57,10 +57,10 @@ export const AgentReasoningBubble = (props: Props) => {
57
57
</ div >
58
58
) ;
59
59
} else if ( item . type === 'html' ) {
60
- const src = ( item . data as string ) ;
60
+ const src = item . data as string ;
61
61
return (
62
62
< div class = "mt-2" >
63
- < div innerHTML = { src } > </ div >
63
+ < div innerHTML = { src } / >
64
64
</ div >
65
65
) ;
66
66
} else {
@@ -86,7 +86,7 @@ export const AgentReasoningBubble = (props: Props) => {
86
86
< div class = "flex flex-row items-start flex-wrap w-full gap-2" >
87
87
< For each = { agentReasoningArtifacts ( props . agentArtifacts ) } >
88
88
{ ( item ) => {
89
- return item !== null ? < > { renderArtifacts ( item ) } </ > : null
89
+ return item !== null ? < > { renderArtifacts ( item ) } </ > : null ;
90
90
} }
91
91
</ For >
92
92
</ div >
0 commit comments