Commit
·
558d4b2
1
Parent(s):
61ac8f9
ui: fallback icon for provider
Browse filesAdded a fallback icon for providers
app/components/settings/providers/ProvidersTab.tsx
CHANGED
|
@@ -5,6 +5,9 @@ import { LOCAL_PROVIDERS, URL_CONFIGURABLE_PROVIDERS } from '~/lib/stores/settin
|
|
| 5 |
import type { IProviderConfig } from '~/types/model';
|
| 6 |
import { logStore } from '~/lib/stores/logs';
|
| 7 |
|
|
|
|
|
|
|
|
|
|
| 8 |
export default function ProvidersTab() {
|
| 9 |
const { providers, updateProviderSettings, isLocalModel } = useSettings();
|
| 10 |
const [filteredProviders, setFilteredProviders] = useState<IProviderConfig[]>([]);
|
|
@@ -51,7 +54,14 @@ export default function ProvidersTab() {
|
|
| 51 |
>
|
| 52 |
<div className="flex items-center justify-between mb-2">
|
| 53 |
<div className="flex items-center gap-2">
|
| 54 |
-
<img
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
<span className="text-bolt-elements-textPrimary">{provider.name}</span>
|
| 56 |
</div>
|
| 57 |
<Switch
|
|
|
|
| 5 |
import type { IProviderConfig } from '~/types/model';
|
| 6 |
import { logStore } from '~/lib/stores/logs';
|
| 7 |
|
| 8 |
+
// Import a default fallback icon
|
| 9 |
+
import DefaultIcon from '/icons/Ollama.svg'; // Adjust the path as necessary
|
| 10 |
+
|
| 11 |
export default function ProvidersTab() {
|
| 12 |
const { providers, updateProviderSettings, isLocalModel } = useSettings();
|
| 13 |
const [filteredProviders, setFilteredProviders] = useState<IProviderConfig[]>([]);
|
|
|
|
| 54 |
>
|
| 55 |
<div className="flex items-center justify-between mb-2">
|
| 56 |
<div className="flex items-center gap-2">
|
| 57 |
+
<img
|
| 58 |
+
src={`/icons/${provider.name}.svg`} // Attempt to load the specific icon
|
| 59 |
+
onError={(e) => { // Fallback to default icon on error
|
| 60 |
+
e.currentTarget.src = DefaultIcon;
|
| 61 |
+
}}
|
| 62 |
+
alt={`${provider.name} icon`}
|
| 63 |
+
className="w-6 h-6 dark:invert"
|
| 64 |
+
/>
|
| 65 |
<span className="text-bolt-elements-textPrimary">{provider.name}</span>
|
| 66 |
</div>
|
| 67 |
<Switch
|