@@ -68,63 +68,59 @@ export const Message = memo<MessageProps>(({
6868 data-message-role = { normalized . role }
6969 data-message-timestamp = { normalized . timestamp }
7070 >
71- { /* Message Content */ }
72- < div className = "w-full min-w-0" >
73- { /* Header */ }
74- < div className = "flex items-center justify-between mb-1" >
75- < div className = "flex items-center gap-2" >
76- { normalized . model && normalized . role === 'assistant' && (
77- < span className = "text-xs text-gray-500 bg-gray-100 px-2 py-1 rounded" >
78- { normalized . model }
71+ { normalized . content . length !== 0 &&
72+ < div className = "w-full min-w-0" >
73+ { /* Header */ }
74+ < div className = "flex items-center justify-between mb-1" >
75+ < div className = "flex items-center gap-2" >
76+ < span className = "text-xs text-gray-500" >
77+ { formatTime ( normalized . timestamp ) }
7978 </ span >
80- ) }
81- < span className = "text-xs text-gray-500" >
82- { formatTime ( normalized . timestamp ) }
83- </ span >
79+ </ div >
80+
81+ { /* Actions */ }
82+ < div className = "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity" >
83+ < button
84+ onClick = { handleCopy }
85+ className = "p-1 hover:bg-gray-200 rounded transition-colors"
86+ title = { copied ? "Copied!" : "Copy message" }
87+ >
88+ { copied ? (
89+ < Check className = "w-4 h-4 text-green-600" />
90+ ) : (
91+ < Copy className = "w-4 h-4 text-gray-600" />
92+ ) }
93+ </ button >
94+ < MessageNoteActions
95+ messageId = { normalized . id }
96+ messageContent = { normalized . content }
97+ messageRole = { normalized . role }
98+ timestamp = { normalized . timestamp }
99+ selectedText = { selectedText }
100+ />
101+ </ div >
84102 </ div >
85-
86- { /* Actions */ }
87- < div className = "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity" >
88- < button
89- onClick = { handleCopy }
90- className = "p-1 hover:bg-gray-200 rounded transition-colors"
91- title = { copied ? "Copied!" : "Copy message" }
92- >
93- { copied ? (
94- < Check className = "w-4 h-4 text-green-600" />
103+
104+ { /* Content */ }
105+ < div className = { `relative rounded-lg border px-3 py-2 w-full min-w-0 max-w-full ${ getMessageStyle ( normalized . role ) } ` } >
106+ < div className = "break-words overflow-wrap-anywhere min-w-0 max-w-full overflow-hidden" >
107+ { normalized . isStreaming ? (
108+ < StreamingMessage
109+ message = { {
110+ id : normalized . id ,
111+ role : normalized . role as "user" | "assistant" | "system" ,
112+ content : normalized . content ,
113+ timestamp : normalized . timestamp ,
114+ isStreaming : normalized . isStreaming
115+ } }
116+ />
95117 ) : (
96- < Copy className = "w-4 h-4 text-gray-600" />
118+ < MarkdownRenderer content = { normalized . content } />
97119 ) }
98- </ button >
99- < MessageNoteActions
100- messageId = { normalized . id }
101- messageContent = { normalized . content }
102- messageRole = { normalized . role }
103- timestamp = { normalized . timestamp }
104- selectedText = { selectedText }
105- />
106- </ div >
107- </ div >
108-
109- { /* Content */ }
110- < div className = { `relative rounded-lg border px-3 py-2 w-full min-w-0 max-w-full ${ getMessageStyle ( normalized . role ) } ` } >
111- < div className = "break-words overflow-wrap-anywhere min-w-0 max-w-full overflow-hidden" >
112- { normalized . isStreaming ? (
113- < StreamingMessage
114- message = { {
115- id : normalized . id ,
116- role : normalized . role as "user" | "assistant" | "system" ,
117- content : normalized . content ,
118- timestamp : normalized . timestamp ,
119- isStreaming : normalized . isStreaming
120- } }
121- />
122- ) : (
123- < MarkdownRenderer content = { normalized . content } />
124- ) }
120+ </ div >
125121 </ div >
126122 </ div >
127- </ div >
123+ }
128124 </ div >
129125 ) ;
130126} ) ;
0 commit comments