forked from e2b-dev/E2B
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProviderIcon.tsx
More file actions
49 lines (43 loc) · 1.09 KB
/
ProviderIcon.tsx
File metadata and controls
49 lines (43 loc) · 1.09 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import { ReactNode } from 'react'
import Image from 'next/image'
import { ModelProvider } from 'state/model'
const iconPaths: {
[provider in keyof typeof ModelProvider]: string
} = {
[ModelProvider.AzureOpenAI]: '/azure-open-ai.png',
[ModelProvider.OpenAI]: '/open-ai.png',
[ModelProvider.Replicate]: '/replicate.png',
[ModelProvider.Anthropic]: '/anthropic.png',
[ModelProvider.HuggingFace]: '/hugging-face.png',
[ModelProvider.Banana]: '/banana.png',
}
export const providerIcons = Object
.values(ModelProvider)
.reduce<{ [provider in keyof typeof ModelProvider]?: ReactNode }>((prev, curr) => ({
...prev,
[curr]: <ProviderIcon provider={curr} />,
}), {})
export interface Props {
provider: ModelProvider
}
function ProviderIcon({ provider }: Props) {
return (
<div className="
w-[30px]
h-[30px]
relative
">
<Image
className="
rounded
"
width={90}
height={90}
alt={`${provider} logo`}
src={iconPaths[provider]}
priority
/>
</div>
)
}
export default ProviderIcon