mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 01:10:14 +01:00
feat: Add user icon in messages (#275)
* Update GPT4 model icon * Add user icon support in messages
This commit is contained in:
parent
9f36e195bc
commit
3120602d6a
1 changed files with 9 additions and 6 deletions
|
|
@ -3,25 +3,28 @@ import React from 'react';
|
|||
import { twMerge } from 'tailwind-merge';
|
||||
import GPTIcon from '../components/svg/GPTIcon';
|
||||
import BingIcon from '../components/svg/BingIcon';
|
||||
import { useAuthContext } from '~/hooks/AuthContext';
|
||||
|
||||
const getIcon = props => {
|
||||
// { size = 30, isCreatedByUser, model, chatGptLabel, error, ...props }
|
||||
const { size = 30, isCreatedByUser, button, model } = props;
|
||||
const { user, logout } = useAuthContext();
|
||||
|
||||
if (isCreatedByUser)
|
||||
return (
|
||||
<div
|
||||
title="User"
|
||||
title={user.name}
|
||||
style={{
|
||||
background: 'radial-gradient(circle at 90% 110%, rgb(1 43 128), rgb(17, 139, 161))',
|
||||
color: 'white',
|
||||
fontSize: 12,
|
||||
width: size,
|
||||
height: size
|
||||
}}
|
||||
className={`relative flex items-center justify-center rounded-sm text-white ` + props?.className}
|
||||
className={`relative flex items-center justify-center` + props?.className}
|
||||
>
|
||||
User
|
||||
<img
|
||||
className="rounded-sm"
|
||||
src={user?.avatar || `https://avatars.dicebear.com/api/initials/${user?.name}.svg`}
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
else if (!isCreatedByUser) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue