@@ -70,25 +70,11 @@ function MessageWrapper({ chat, children }: { chat: Chat, children: React.ReactN
7070 }
7171
7272 const index = chats . findIndex ( item => item . id === chat . id )
73- if ( chat . role === 'system' ) {
74- return < div className = "flex w-full lg:gap-4" >
75- < div className = 'hidden lg:flex' >
76- { loading && index === chats . length - 1 && chat . type === 'chat' ?
77- < LoaderPinwheel className = "animate-spin" /> :
78- chat . type === 'clipboard' ? < ClipboardCheck /> : < BotMessageSquare />
79- }
80- </ div >
81- < div className = 'text-sm leading-6 flex-1 lg:max-w-[calc(100vw-460px)] break-words' >
82- { children }
83- </ div >
84- </ div >
85- } else {
86- return < div className = "flex group items-center lg:gap-4" >
87- < div className = "bg-primary text-primary-foreground px-4 py-2 rounded-lg lg:max-w-[calc(100vw-600px)]" >
88- { chat . content }
89- </ div >
73+ return < div className = "flex w-full lg:gap-4" >
74+ {
75+ chat . role === 'user' ?
9076 < div className = "relative" >
91- < Avatar className = 'rounded size-9 items-center justify-center hidden lg:flex' >
77+ < Avatar className = 'rounded size-6 items-center justify-center hidden lg:flex' >
9278 {
9379 userInfo ?. avatar_url ?
9480 < AvatarImage src = { userInfo ?. avatar_url } /> : < UserRound />
@@ -97,9 +83,18 @@ function MessageWrapper({ chat, children }: { chat: Chat, children: React.ReactN
9783 < Button onClick = { revertChat } size = "icon" className = "absolute top-0 right-0 hidden group-hover:flex" >
9884 < Undo2 />
9985 </ Button >
86+ </ div > :
87+ < div className = 'hidden lg:flex' >
88+ { loading && index === chats . length - 1 && chat . type === 'chat' ?
89+ < LoaderPinwheel className = "animate-spin" /> :
90+ chat . type === 'clipboard' ? < ClipboardCheck /> : < BotMessageSquare />
91+ }
10092 </ div >
93+ }
94+ < div className = 'text-sm leading-6 flex-1 break-words' >
95+ { children }
10196 </ div >
102- }
97+ </ div >
10398}
10499
105100function Message ( { chat } : { chat : Chat } ) {
0 commit comments