( platformId: string, platforms: T, fallback = 'Link', )
| 401 | * Get platform label |
| 402 | */ |
| 403 | export function getPlatformLabel<T extends Record<string, PlatformConfig>>( |
| 404 | platformId: string, |
| 405 | platforms: T, |
| 406 | fallback = 'Link', |
| 407 | ): string { |
| 408 | const config = platforms[platformId]; |
| 409 | if (config) { |
| 410 | return config.label; |
| 411 | } |
| 412 | // Capitalize first letter as fallback |
| 413 | return platformId.charAt(0).toUpperCase() + platformId.slice(1) || fallback; |
| 414 | } |
| 415 | |
| 416 | /** |
| 417 | * Build URL from username using platform's urlBuilder |
no outgoing calls
no test coverage detected