diff --git a/src/features/ai/components/icons/provider-icons.tsx b/src/features/ai/components/icons/provider-icons.tsx index 0fad5be0f..229e029d3 100644 --- a/src/features/ai/components/icons/provider-icons.tsx +++ b/src/features/ai/components/icons/provider-icons.tsx @@ -2,6 +2,19 @@ import type { SVGProps } from "react"; import { cn } from "@/utils/cn"; type IconProps = SVGProps & { size?: number }; +export type ProviderIconKind = + | "openai" + | "v0" + | "anthropic" + | "gemini" + | "xai" + | "deepseek" + | "mistral" + | "ollama" + | "openrouter" + | "moonshot" + | "qwen" + | "custom"; const defaultProps = (size = 14, className?: string): SVGProps => ({ width: size, @@ -139,31 +152,49 @@ export function CustomAPIIcon({ size, className, ...props }: IconProps) { export function ProviderIcon({ providerId, + catalogIconUrl, size = 14, className, }: { providerId: string; + catalogIconUrl?: string | null; size?: number; className?: string; }) { const props = { size, className: cn("shrink-0", className) }; + const resolvedCatalogIconUrl = resolveCatalogIconUrl(catalogIconUrl); - switch (providerId) { + if (resolvedCatalogIconUrl) { + return ( +