Skip to content

Commit

Permalink
fix: render logo each engine instead each model engine
Browse files Browse the repository at this point in the history
  • Loading branch information
urmauur committed Aug 7, 2024
1 parent 105a9aa commit 5ec9419
Showing 1 changed file with 22 additions and 24 deletions.
46 changes: 22 additions & 24 deletions web/containers/ModelDropdown/ModelSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,39 +56,37 @@ const ModelSection: React.FC<Props> = ({

return (
<div className="w-full pt-2">
<h6 className="mb-1 px-3 font-medium text-[hsla(var(--text-secondary))]">
{engineName}
</h6>
<div className="flex justify-between pr-2">
<div className="flex gap-2 pl-3">
{engineLogo && (
<Image
className="h-5 w-5 flex-shrink-0 rounded-full object-cover"
width={40}
height={40}
src={engineLogo}
alt="logo"
/>
)}
<h6 className="mb-1 pr-3 font-medium text-[hsla(var(--text-secondary))]">
{engineName}
</h6>
</div>
<Button theme="icon" onClick={onSettingClick}>
<SettingsIcon
size={14}
className="text-[hsla(var(--text-secondary))]"
/>
</Button>
</div>
<ul className="pb-2">
{models.map((model) => (
<li
key={model.model}
className="flex cursor-pointer items-center gap-2 px-3 py-2 hover:bg-[hsla(var(--dropdown-menu-hover-bg))]"
onClick={() => onModelSelected(model)}
>
{model.metadata?.logo ? (
<Image
className="rounded-full object-cover"
width={20}
height={20}
src={model.metadata?.logo}
alt="logo"
/>
) : (
!model.engine?.includes('cortex.') && (
<div className="flex h-5 w-5 items-center justify-center rounded-full border border-[hsla(var(--app-border))] bg-gradient-to-r from-cyan-500 to-blue-500" />
)
)}
<div className="flex w-full items-center justify-between">
<p className="line-clamp-1">{model.name ?? model.model}</p>
{!model.engine?.includes('cortex.') && (
<Button theme="icon" onClick={onSettingClick}>
<SettingsIcon
size={14}
className="text-[hsla(var(--text-secondary))]"
/>
</Button>
)}
</div>
<ModelLabel metadata={model.metadata} compact />
</li>
Expand Down

0 comments on commit 5ec9419

Please sign in to comment.