show avatar dialog instead of default (#4033)

show avatar dialog instead of default

- [x] New Feature (non-breaking change which adds functionality)

---------

Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
This commit is contained in:
so95
2024-12-17 16:29:35 +07:00
committed by GitHub
parent 09436f6c60
commit 251592eeeb
14 changed files with 159 additions and 12 deletions

View File

@ -30,6 +30,7 @@ interface IProps extends Partial<IRemoveMessageById>, IRegenerateMessage {
sendLoading?: boolean;
nickname?: string;
avatar?: string;
avatardialog?: string | null;
clickDocumentButton?: (documentId: string, chunk: IReferenceChunk) => void;
index: number;
showLikeButton?: boolean;
@ -40,6 +41,7 @@ const MessageItem = ({
reference,
loading = false,
avatar,
avatardialog,
sendLoading = false,
clickDocumentButton,
index,
@ -103,8 +105,10 @@ const MessageItem = ({
>
{item.role === MessageType.User ? (
<Avatar size={40} src={avatar ?? '/logo.svg'} />
) : avatardialog ? (
<Avatar size={40} src={avatardialog} />
) : (
<AssistantIcon></AssistantIcon>
<AssistantIcon />
)}
<Flex vertical gap={8} flex={1}>
<Space>