( platformId: string, platforms: T, size: IconSize, fallback: PlatformConfig = USER_ONLY_PLATFORMS.other, )
| 385 | * Get platform icon element |
| 386 | */ |
| 387 | export function getPlatformIconElement< |
| 388 | T extends Record<string, PlatformConfig>, |
| 389 | >( |
| 390 | platformId: string, |
| 391 | platforms: T, |
| 392 | size: IconSize, |
| 393 | fallback: PlatformConfig = USER_ONLY_PLATFORMS.other, |
| 394 | ): ReactElement { |
| 395 | const config = platforms[platformId] || fallback; |
| 396 | const IconComponent = config.icon; |
| 397 | return <IconComponent size={size} />; |
| 398 | } |
| 399 | |
| 400 | /** |
| 401 | * Get platform label |
no outgoing calls
no test coverage detected