Skip to content

Commit

Permalink
chore: add engine logo from local instead of metadata logo (#3363)
Browse files Browse the repository at this point in the history
  • Loading branch information
urmauur committed Aug 13, 2024
1 parent 3b2c84c commit ad6fbea
Show file tree
Hide file tree
Showing 14 changed files with 161 additions and 21 deletions.
18 changes: 12 additions & 6 deletions web/containers/ModelDropdown/ModelSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ import { twMerge } from 'tailwind-merge'
import useEngineQuery from '@/hooks/useEngineQuery'
import useGetModelsByEngine from '@/hooks/useGetModelsByEngine'

import { getLogoByLocalEngine, getTitleByCategory } from '@/utils/model-engine'
import {
getLogoByLocalEngine,
getLogoByRemoteEngine,
getTitleByCategory,
} from '@/utils/model-engine'

import ModelLabel from '../ModelLabel'

Expand Down Expand Up @@ -96,6 +100,7 @@ const ModelSection: React.FC<Props> = ({

const engineName = getTitleByCategory(engine)
const localEngineLogo = getLogoByLocalEngine(engine as LocalEngine)
const remoteEngineLogo = getLogoByRemoteEngine(engine as RemoteEngine)
const isRemoteEngine = RemoteEngines.includes(engine as RemoteEngine)

if (models.length === 0) return null
Expand All @@ -107,22 +112,23 @@ const ModelSection: React.FC<Props> = ({
className="flex cursor-pointer gap-2 pl-3"
onClick={onClickChevron}
>
{!isRemoteEngine && (
{!isRemoteEngine && localEngineLogo && (
<Image
className="h-5 w-5 flex-shrink-0 rounded-full object-cover"
width={40}
height={40}
src={localEngineLogo as string}
src={localEngineLogo}
alt="logo"
/>
)}
{engineLogo && (

{remoteEngineLogo && (
<Image
className="h-5 w-5 flex-shrink-0 rounded-full object-cover"
width={40}
height={40}
src={engineLogo}
alt="logo"
src={remoteEngineLogo}
alt={`logo - ${engine}`}
/>
)}
<h6 className="pr-3 font-medium text-[hsla(var(--text-secondary))]">
Expand Down
9 changes: 9 additions & 0 deletions web/public/icons/anthropic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions web/public/icons/cohere.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions web/public/icons/dot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions web/public/icons/groq.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions web/public/icons/martian.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions web/public/icons/mistral.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions web/public/icons/nvidia.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions web/public/icons/openRouter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ad6fbea

Please sign in to comment.