fix(ai): use local provider icons
This commit is contained in:
1 parent
531634d9b6
commit
3fc6c0eaba
13 files changed
+12
-26
No files matched your search
@@ -27,16 +27,10 @@ const usesWhiteDarkIcon = computed(
|
||||
props.provider === "openai" ||
|
||||
props.provider === "openai-compatible",
|
||||
);
|
||||
const localIconUrl = computed(() =>
|
||||
props.provider === "openai" || props.provider === "openai-compatible" ? "/icons/ai/openai.svg" : "",
|
||||
);
|
||||
const iconUrl = computed(
|
||||
() =>
|
||||
localIconUrl.value ||
|
||||
(props.iconSlug
|
||||
? `https://cdn.simpleicons.org/${props.iconSlug}${isDark.value && usesWhiteDarkIcon.value ? "/f8fafc" : ""}`
|
||||
: ""),
|
||||
);
|
||||
const localIconUrl = computed(() => {
|
||||
if (props.provider === "openai-compatible") return "/icons/ai/openai.svg";
|
||||
return props.iconSlug ? `/icons/ai/${props.iconSlug}.svg` : "";
|
||||
});
|
||||
const fallbackText = computed(() => {
|
||||
if (props.provider === "openai-compatible") return "OC";
|
||||
return props.label.slice(0, 1).toUpperCase();
|
||||
@@ -47,12 +41,11 @@ const fallbackText = computed(() => {
|
||||
<span class="flex h-4 w-4 shrink-0 items-center justify-center overflow-hidden rounded-sm">
|
||||
<Settings2 v-if="provider === 'custom'" class="h-4 w-4 text-muted-foreground" />
|
||||
<img
|
||||
v-else-if="iconUrl && !failed"
|
||||
:src="iconUrl"
|
||||
v-else-if="localIconUrl && !failed"
|
||||
:src="localIconUrl"
|
||||
:alt="label"
|
||||
class="h-4 w-4 object-contain"
|
||||
:class="{ 'dark:invert': localIconUrl }"
|
||||
loading="lazy"
|
||||
:class="{ 'dark:invert': isDark && usesWhiteDarkIcon }"
|
||||
@error="failed = true"
|
||||
/>
|
||||
<span v-else class="flex h-4 w-4 items-center justify-center rounded-sm bg-muted text-[8px] font-semibold">
|
||||
|
||||
Reference in new issue
Block a user