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

@ -2,7 +2,7 @@ import { useState } from 'react';
import { useRecoilValue } from 'recoil';
import { Settings } from 'lucide-react';
import { DropdownMenuRadioItem } from '~/components';
import { getIcon } from '~/components/Endpoints';
import { Icon } from '~/components/Endpoints';
import { SetKeyDialog } from '../SetKeyDialog';
import { useLocalize } from '~/hooks';
@ -21,7 +21,7 @@ export default function ModelItem({
const [isDialogOpen, setDialogOpen] = useState(false);
const endpointsConfig = useRecoilValue(store.endpointsConfig);
const icon = getIcon({
const icon = Icon({
size: 20,
endpoint,
error: false,

View file

@ -3,7 +3,7 @@ import { Trash2 } from 'lucide-react';
import { useState, useEffect } from 'react';
import { useRecoilValue, useRecoilState } from 'recoil';
import { useDeletePresetMutation, useCreatePresetMutation } from 'librechat-data-provider';
import { getIcon, EditPresetDialog } from '~/components/Endpoints';
import { Icon, EditPresetDialog } from '~/components/Endpoints';
import EndpointItems from './EndpointItems';
import PresetItems from './PresetItems';
import FileUpload from './FileUpload';
@ -136,10 +136,9 @@ export default function NewConversationMenu() {
deletePresetsMutation.mutate({ arg: preset });
};
const icon = getIcon({
const icon = Icon({
size: 32,
...conversation,
isCreatedByUser: false,
error: false,
button: true,
});

View file

@ -1,7 +1,7 @@
import type { TPresetItemProps } from '~/common';
import type { TPreset } from 'librechat-data-provider';
import { DropdownMenuRadioItem, EditIcon, TrashIcon } from '~/components';
import { getIcon } from '~/components/Endpoints';
import { Icon } from '~/components/Endpoints';
export default function PresetItem({
preset = {} as TPreset,
@ -11,7 +11,7 @@ export default function PresetItem({
}: TPresetItemProps) {
const { endpoint } = preset;
const icon = getIcon({
const icon = Icon({
size: 20,
endpoint: preset?.endpoint,
model: preset?.model,