feat: icons for chat identification (#879)

* Added endpoint picture

* plugin icon fix & new minimalist icon

* changed from BingAIMinimalIcon to BingAIMinimalistIcon

* fix(Conversation) reduced the space between the icon and the title

* refactor(getIcon & getMinimalIcon)

* moved IconProps in ~/common

* refactor(getIcon & getMinimalistIcon) from switch/case to map

* fix(getIcon.tsx) renamed to Icon

* renamed all from Minimalist to Minimal
This commit is contained in:
Marco Beretta 2023-09-18 21:21:39 +02:00 committed by GitHub
parent 6358383001
commit 2419af8748
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 356 additions and 126 deletions

View file

@ -3,7 +3,7 @@ import { useRecoilState, useSetRecoilState } from 'recoil';
import { useUpdateConversationMutation } from 'librechat-data-provider';
import RenameButton from './RenameButton';
import DeleteButton from './DeleteButton';
import ConvoIcon from '../svg/ConvoIcon';
import { MinimalIcon } from '~/components/Endpoints';
import { useConversations, useConversation } from '~/hooks';
import store from '~/store';
@ -66,6 +66,14 @@ export default function Conversation({ conversation, retainView }) {
updateConvoMutation.mutate({ conversationId, title: titleInput });
};
const icon = MinimalIcon({
size: 20,
endpoint: conversation.endpoint,
model: conversation.model,
error: false,
className: 'mr-0',
});
useEffect(() => {
if (updateConvoMutation.isSuccess) {
refreshConversations();
@ -97,7 +105,7 @@ export default function Conversation({ conversation, retainView }) {
return (
<a data-testid="convo-item" onClick={() => clickHandler()} {...aProps}>
<ConvoIcon />
{icon}
<div className="relative max-h-5 flex-1 overflow-hidden text-ellipsis break-all">
{renaming === true ? (
<input