From 5ee6aceb6000b81f092eb28d50496fb377ff3b0c Mon Sep 17 00:00:00 2001 From: Enrico Ros Date: Wed, 6 Mar 2024 21:51:15 -0800 Subject: [PATCH] cleanups --- .../chat/components/message/ChatMessage.tsx | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/apps/chat/components/message/ChatMessage.tsx b/src/apps/chat/components/message/ChatMessage.tsx index 2657bc40a..8e387773f 100644 --- a/src/apps/chat/components/message/ChatMessage.tsx +++ b/src/apps/chat/components/message/ChatMessage.tsx @@ -64,6 +64,7 @@ const avatarIconSx = { width: 36, height: 36 }; export function makeAvatar(messageAvatar: string | null, messageRole: DMessage['role'] | string, messageOriginLLM: string | undefined, messagePurposeId: SystemPurposeId | undefined, messageSender: string, messageTyping: boolean, size: 'sm' | undefined = undefined): React.JSX.Element { if (typeof messageAvatar === 'string' && messageAvatar) return ; + const mascotSx = size === 'sm' ? avatarIconSx : { width: 64, height: 64 }; switch (messageRole) { case 'system': @@ -76,17 +77,18 @@ export function makeAvatar(messageAvatar: string | null, messageRole: DMessage[' // typing gif (people seem to love this, so keeping it after april fools') const isTextToImage = messageOriginLLM === 'DALLĀ·E' || messageOriginLLM === 'Prodia'; const isReact = messageOriginLLM?.startsWith('react-'); - if (messageTyping) { + + // animation: message typing + if (messageTyping) return ; - } - // text-to-image: icon + // icon: text-to-image if (isTextToImage) return - {symbol} - ; + if (symbol) + return + {symbol} + ; // default assistant avatar return ; // https://mui.com/static/images/avatar/2.jpg