summaryrefslogtreecommitdiffhomepage
path: root/packages/app/src/components/settings-providers.tsx
diff options
context:
space:
mode:
authormridul <[email protected]>2026-03-01 02:43:23 +0530
committerGitHub <[email protected]>2026-02-28 15:13:23 -0600
commit971bd30516fb2b245f87bdf79e36bb64e72265bc (patch)
treefc0d71bb442ccf35e5e6d099f83fbbcb814112b0 /packages/app/src/components/settings-providers.tsx
parent2a2082233d9e8bda4674ce596f04b61b3b32522d (diff)
downloadopencode-971bd30516fb2b245f87bdf79e36bb64e72265bc.tar.gz
opencode-971bd30516fb2b245f87bdf79e36bb64e72265bc.zip
fix(app): fallback to synthetic icon for unknown provider IDs (#15295)
Diffstat (limited to 'packages/app/src/components/settings-providers.tsx')
-rw-r--r--packages/app/src/components/settings-providers.tsx12
1 files changed, 3 insertions, 9 deletions
diff --git a/packages/app/src/components/settings-providers.tsx b/packages/app/src/components/settings-providers.tsx
index 6fac9feca..21db62950 100644
--- a/packages/app/src/components/settings-providers.tsx
+++ b/packages/app/src/components/settings-providers.tsx
@@ -3,7 +3,6 @@ import { useDialog } from "@opencode-ai/ui/context/dialog"
import { ProviderIcon } from "@opencode-ai/ui/provider-icon"
import { Tag } from "@opencode-ai/ui/tag"
import { showToast } from "@opencode-ai/ui/toast"
-import { iconNames, type IconName } from "@opencode-ai/ui/icons/provider"
import { popularProviders, useProviders } from "@/hooks/use-providers"
import { createMemo, type Component, For, Show } from "solid-js"
import { useLanguage } from "@/context/language"
@@ -33,11 +32,6 @@ export const SettingsProviders: Component = () => {
const globalSync = useGlobalSync()
const providers = useProviders()
- const icon = (id: string): IconName => {
- if (iconNames.includes(id as IconName)) return id as IconName
- return "synthetic"
- }
-
const connected = createMemo(() => {
return providers
.connected()
@@ -154,7 +148,7 @@ export const SettingsProviders: Component = () => {
{(item) => (
<div class="group flex flex-wrap items-center justify-between gap-4 min-h-16 py-3 border-b border-border-weak-base last:border-none">
<div class="flex items-center gap-3 min-w-0">
- <ProviderIcon id={icon(item.id)} class="size-5 shrink-0 icon-strong-base" />
+ <ProviderIcon id={item.id} class="size-5 shrink-0 icon-strong-base" />
<span class="text-14-medium text-text-strong truncate">{item.name}</span>
<Tag>{type(item)}</Tag>
</div>
@@ -185,7 +179,7 @@ export const SettingsProviders: Component = () => {
<div class="flex flex-wrap items-center justify-between gap-4 min-h-16 py-3 border-b border-border-weak-base last:border-none">
<div class="flex flex-col min-w-0">
<div class="flex items-center gap-x-3">
- <ProviderIcon id={icon(item.id)} class="size-5 shrink-0 icon-strong-base" />
+ <ProviderIcon id={item.id} class="size-5 shrink-0 icon-strong-base" />
<span class="text-14-medium text-text-strong">{item.name}</span>
<Show when={item.id === "opencode"}>
<span class="text-14-regular text-text-weak">
@@ -228,7 +222,7 @@ export const SettingsProviders: Component = () => {
>
<div class="flex flex-col min-w-0">
<div class="flex flex-wrap items-center gap-x-3 gap-y-1">
- <ProviderIcon id={icon("synthetic")} class="size-5 shrink-0 icon-strong-base" />
+ <ProviderIcon id="synthetic" class="size-5 shrink-0 icon-strong-base" />
<span class="text-14-medium text-text-strong">{language.t("provider.custom.title")}</span>
<Tag>{language.t("settings.providers.tag.custom")}</Tag>
</div>