@@ -76,7 +76,6 @@ const MessageAttachments = memo(({
7676 flexDirection : 'row' ,
7777 gap : 1 ,
7878 flexWrap : 'wrap' ,
79- marginTop : 1 ,
8079 } }
8180 >
8281 { imageAttachments . map ( ( attachment ) => (
@@ -255,53 +254,55 @@ export const MessageBlock = memo(({
255254 </ box >
256255 ) }
257256
258- { blocks ? (
259- < box
260- style = { {
261- flexDirection : 'column' ,
262- gap : 0 ,
263- width : '100%' ,
264- paddingTop : 0 ,
265- } }
266- >
267- < BlocksRenderer
268- sourceBlocks = { blocks }
257+ < box style = { { flexDirection : 'column' , gap : 1 , width : '100%' } } >
258+ { blocks ? (
259+ < box
260+ style = { {
261+ flexDirection : 'column' ,
262+ gap : 0 ,
263+ width : '100%' ,
264+ paddingTop : 0 ,
265+ } }
266+ >
267+ < BlocksRenderer
268+ sourceBlocks = { blocks }
269+ messageId = { messageId }
270+ isLoading = { isLoading }
271+ isComplete = { isComplete }
272+ isUser = { isUser }
273+ textColor = { resolvedTextColor }
274+ availableWidth = { availableWidth }
275+ markdownPalette = { markdownPalette }
276+ onToggleCollapsed = { onToggleCollapsed }
277+ onBuildFast = { onBuildFast }
278+ onBuildMax = { onBuildMax }
279+ isLastMessage = { isLastMessage }
280+ contentToCopy = { isUser ? content : undefined }
281+ />
282+ </ box >
283+ ) : (
284+ < UserContentWithCopyButton
285+ content = { content }
269286 messageId = { messageId }
270287 isLoading = { isLoading }
271288 isComplete = { isComplete }
272289 isUser = { isUser }
273290 textColor = { resolvedTextColor }
274- availableWidth = { availableWidth }
275- markdownPalette = { markdownPalette }
276- onToggleCollapsed = { onToggleCollapsed }
277- onBuildFast = { onBuildFast }
278- onBuildMax = { onBuildMax }
279- isLastMessage = { isLastMessage }
280- contentToCopy = { isUser ? content : undefined }
281- />
282- </ box >
283- ) : (
284- < UserContentWithCopyButton
285- content = { content }
286- messageId = { messageId }
287- isLoading = { isLoading }
288- isComplete = { isComplete }
289- isUser = { isUser }
290- textColor = { resolvedTextColor }
291- codeBlockWidth = { markdownOptions . codeBlockWidth }
292- palette = { markdownOptions . palette }
293- showCopyButton = { isUser }
294- />
295- ) }
296- { /* Show attachments for user messages */ }
297- { isUser &&
298- ( ( attachments && attachments . length > 0 ) ||
299- ( textAttachments && textAttachments . length > 0 ) ) && (
300- < MessageAttachments
301- imageAttachments = { attachments ?? [ ] }
302- textAttachments = { textAttachments ?? [ ] }
291+ codeBlockWidth = { markdownOptions . codeBlockWidth }
292+ palette = { markdownOptions . palette }
293+ showCopyButton = { isUser }
303294 />
304295 ) }
296+ { /* Show attachments for user messages */ }
297+ { isUser &&
298+ ( ( attachments && attachments . length > 0 ) ||
299+ ( textAttachments && textAttachments . length > 0 ) ) && (
300+ < MessageAttachments
301+ imageAttachments = { attachments ?? [ ] }
302+ textAttachments = { textAttachments ?? [ ] }
303+ />
304+ ) }
305+ </ box >
305306
306307 { /* Display runtime error banner for AI messages */ }
307308 { isAi && userError && < UserErrorBanner error = { userError } /> }
0 commit comments