feat: new endpoint-style icon

This commit is contained in:
Wentao Lyu 2023-03-31 01:41:41 +08:00
parent 7e8b31cd09
commit 089ca5f120
5 changed files with 91 additions and 86 deletions

View file

@ -6,7 +6,7 @@ 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';
import getIcon from '~/utils/getIcon';
import store from '~/store';
@ -31,7 +31,7 @@ export default function ModelItem({ model: _model, value, onSelect }) {
setCustomGPTModels(fetchedModels);
});
const icon = getIconOfModel({
const icon = getIcon({
size: 20,
sender: chatGptLabel || model,
isCreatedByUser: false,

View file

@ -4,7 +4,7 @@ import axios from 'axios';
import ModelDialog from './ModelDialog';
import MenuItems from './MenuItems';
import { swr } from '~/utils/fetchers';
import { getIconOfModel } from '~/utils';
import getIcon from '~/utils/getIcon';
import { Button } from '../../ui/Button.tsx';
import {
@ -145,7 +145,7 @@ export default function ModelMenu() {
];
const colorProps = model === 'chatgpt' ? chatgptColorProps : defaultColorProps;
const icon = getIconOfModel({
const icon = getIcon({
size: 32,
sender: chatGptLabel || model,
isCreatedByUser: false,

View file

@ -6,7 +6,7 @@ import MultiMessage from './MultiMessage';
import HoverButtons from './HoverButtons';
import SiblingSwitch from './SiblingSwitch';
import { fetchById } from '~/utils/fetchers';
import { getIconOfAi } from '~/utils';
import getIcon from '~/utils/getIcon';
import { useMessageHandler } from '~/utils/handleSubmit';
import store from '~/store';
@ -60,7 +60,7 @@ export default function Message({
'w-full border-b border-black/10 dark:border-gray-900/50 text-gray-800 bg-white dark:text-gray-100 group dark:bg-gray-800'
};
const icon = getIconOfAi({
const icon = getIcon({
...conversation,
...message
});