mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-25 11:46:12 +01:00
feat: show icon within model select menu
fix: use icon for gptCustom
This commit is contained in:
parent
54aa9debb4
commit
5d0b849930
7 changed files with 80 additions and 56 deletions
|
|
@ -2,6 +2,7 @@ import React from 'react';
|
|||
import ModelItem from './ModelItem';
|
||||
|
||||
export default function MenuItems({ models, onSelect }) {
|
||||
console.log(models)
|
||||
return (
|
||||
<>
|
||||
{models.map((modelItem) => (
|
||||
|
|
@ -11,6 +12,8 @@ export default function MenuItems({ models, onSelect }) {
|
|||
modelName={modelItem.name}
|
||||
value={modelItem.value}
|
||||
onSelect={onSelect}
|
||||
chatGptLabel={modelItem.chatGptLabel}
|
||||
promptPrefix={modelItem.promptPrefix}
|
||||
/>
|
||||
))}
|
||||
</>
|
||||
|
|
|
|||
|
|
@ -7,8 +7,9 @@ import { DialogTrigger } from '../ui/Dialog.tsx';
|
|||
import RenameButton from '../Conversations/RenameButton';
|
||||
import TrashIcon from '../svg/TrashIcon';
|
||||
import manualSWR from '~/utils/fetchers';
|
||||
import { getIconOfModel } from '../../utils';
|
||||
|
||||
export default function ModelItem({ modelName, value, onSelect, id }) {
|
||||
export default function ModelItem({ modelName, value, onSelect, id, chatGptLabel, promptPrefix }) {
|
||||
const dispatch = useDispatch();
|
||||
const { customModel } = useSelector((state) => state.submit);
|
||||
const { initial } = useSelector((state) => state.models);
|
||||
|
|
@ -27,6 +28,8 @@ export default function ModelItem({ modelName, value, onSelect, id }) {
|
|||
dispatch(setModels(fetchedModels));
|
||||
});
|
||||
|
||||
const icon = getIconOfModel({ size: 16, sender: modelName, isCreatedByUser: false, model: value, chatGptLabel, promptPrefix, error: false, className: "mr-2" });
|
||||
|
||||
if (value === 'chatgptCustom') {
|
||||
return (
|
||||
<DialogTrigger className="w-full">
|
||||
|
|
@ -34,6 +37,7 @@ export default function ModelItem({ modelName, value, onSelect, id }) {
|
|||
value={value}
|
||||
className="dark:font-semibold dark:text-gray-100 dark:hover:bg-gray-800"
|
||||
>
|
||||
{icon}
|
||||
{modelName}
|
||||
<sup>$</sup>
|
||||
</DropdownMenuRadioItem>
|
||||
|
|
@ -47,6 +51,7 @@ export default function ModelItem({ modelName, value, onSelect, id }) {
|
|||
value={value}
|
||||
className="dark:font-semibold dark:text-gray-100 dark:hover:bg-gray-800"
|
||||
>
|
||||
{icon}
|
||||
{modelName}
|
||||
{value === 'chatgpt' && <sup>$</sup>}
|
||||
</DropdownMenuRadioItem>
|
||||
|
|
@ -122,6 +127,9 @@ export default function ModelItem({ modelName, value, onSelect, id }) {
|
|||
<Circle className="h-2 w-2 fill-current" />
|
||||
</span>
|
||||
)}
|
||||
|
||||
{icon}
|
||||
|
||||
{renaming === true ? (
|
||||
<input
|
||||
ref={inputRef}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue