getMcpIconSrc.ts17 lines · main
| 1 | import { getMcpClientIconAssetUrl } from './mcpIconAssets' |
| 2 | |
| 3 | /** |
| 4 | * Returns the URL to an imported MCP client icon asset. |
| 5 | * Dark variants are only used when the client has a distinct dark asset. |
| 6 | */ |
| 7 | export function getMcpClientIconSrc({ |
| 8 | icon, |
| 9 | useDarkVariant, |
| 10 | hasDistinctDarkIcon, |
| 11 | }: { |
| 12 | icon: string |
| 13 | useDarkVariant: boolean |
| 14 | hasDistinctDarkIcon?: boolean |
| 15 | }): string { |
| 16 | return getMcpClientIconAssetUrl(icon, useDarkVariant && Boolean(hasDistinctDarkIcon)) |
| 17 | } |