File size: 599 Bytes
a8aec61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { IconType } from '@/components/ui/icon'

const PROVIDER_ICON_MAP: Record<string, IconType> = {
  aws: 'aws',
  openai: 'open-ai',
  anthropic: 'anthropic',
  mistral: 'mistral',
  gemini: 'gemini',
  azure: 'azure',
  groq: 'groq',
  fireworks: 'fireworks',
  deepseek: 'deepseek',
  cohere: 'cohere',
  ollama: 'ollama',
  xai: 'xai'
}

export const getProviderIcon = (provider: string): IconType | null => {
  const normalizedProvider = provider.toLowerCase()
  return (
    Object.entries(PROVIDER_ICON_MAP).find(([key]) =>
      normalizedProvider.includes(key)
    )?.[1] ?? null
  )
}