fix(webui): align provider icons across compact surfaces
This commit is contained in:
1 parent
5aac672b98
commit
f4d863a148
7 files changed
+149
-9
No files matched your search
@@ -617,13 +617,15 @@ function PresetProviderIcon({
|
||||
}) {
|
||||
const inferredProvider = provider || inferProviderFromModelName(modelDetail || label);
|
||||
const brand = providerBrand(inferredProvider);
|
||||
const { logoUrl, onLogoError, onLogoLoad } = useLogoFallback(brand?.logoUrls);
|
||||
const { logoUrl, logoLoaded, onLogoError, onLogoLoad } = useLogoFallback(brand?.logoUrls);
|
||||
const isLogoTile = brand?.logoLayout === "tile" && logoUrl === brand.logoUrl;
|
||||
return (
|
||||
<span
|
||||
data-testid={testId}
|
||||
className={cn(
|
||||
"grid shrink-0 place-items-center",
|
||||
"grid shrink-0 place-items-center overflow-hidden rounded-[5px]",
|
||||
isHero ? "h-4 w-4" : "h-[18px] w-[18px]",
|
||||
logoUrl && (logoLoaded ? (isLogoTile ? "bg-transparent" : "bg-white") : "bg-muted"),
|
||||
)}
|
||||
aria-hidden
|
||||
>
|
||||
@@ -634,7 +636,12 @@ function PresetProviderIcon({
|
||||
draggable={false}
|
||||
decoding="async"
|
||||
loading="lazy"
|
||||
className={cn("object-contain", isHero ? "h-3.5 w-3.5" : "h-[18px] w-[18px]")}
|
||||
referrerPolicy="no-referrer"
|
||||
className={cn(
|
||||
"object-contain",
|
||||
isLogoTile ? "h-full w-full" : "h-3.5 w-3.5",
|
||||
logoLoaded ? "opacity-100" : "opacity-0",
|
||||
)}
|
||||
onLoad={onLogoLoad}
|
||||
onError={onLogoError}
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user