From b90bbc8363517b58e7bc269e2e6b780d431b0d2a Mon Sep 17 00:00:00 2001 From: Timothy Carambat Date: Tue, 20 Jan 2026 23:04:09 -0800 Subject: [PATCH] add fallback key to mono model provider --- frontend/src/components/lib/MonoProviderIcon/index.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/lib/MonoProviderIcon/index.jsx b/frontend/src/components/lib/MonoProviderIcon/index.jsx index f91bb0f45..942192190 100644 --- a/frontend/src/components/lib/MonoProviderIcon/index.jsx +++ b/frontend/src/components/lib/MonoProviderIcon/index.jsx @@ -46,7 +46,8 @@ const modelPatterns = [ { pattern: /^claude-/i, icon: Anthropic }, { pattern: /^gemini-/i, icon: Gemini }, { pattern: /gemma/i, icon: Gemma }, - { pattern: /^llama/i, icon: Meta }, + { pattern: /llama/i, icon: Meta }, + { pattern: /^meta/i, icon: Meta }, { pattern: /^(mistral|devstral|mixtral|magistral|codestral|ministral)/i, icon: Mistral, @@ -80,6 +81,8 @@ function findIconByModelName(modelName) { * @param {string} props.provider - The provider key (for exact match) or model name (for pattern match). * @param {('exact'|'pattern')} props.match - Match mode: 'exact' for provider key, 'pattern' for model name matching. * @param {number} props.size - The size of the icon. + * @param {string} props.className - The class name of the icon. + * @param {string} props.fallbackIconKey - The key of the fallback icon to use if no icon is found. * @returns {React.ReactNode} */ export default function MonoProviderIcon({ @@ -87,11 +90,14 @@ export default function MonoProviderIcon({ match = "exact", size = 24, className = "", + fallbackIconKey = null, }) { let Icon = null; if (match === "exact") Icon = providerIcons[provider?.toLowerCase()]; else if (match === "pattern") Icon = findIconByModelName(provider); + if (!Icon && fallbackIconKey && providerIcons[fallbackIconKey]) + Icon = providerIcons[fallbackIconKey]; if (!Icon) return null; return ; }