diff --git a/static/app/utils/replays/generatePlatformIconName.tsx b/static/app/utils/replays/generatePlatformIconName.tsx index d49a9251d40ad7..8f62785d62ec91 100644 --- a/static/app/utils/replays/generatePlatformIconName.tsx +++ b/static/app/utils/replays/generatePlatformIconName.tsx @@ -1,25 +1,6 @@ +import {getLogoImage} from 'sentry/components/events/contexts/contextIcon'; import {generateIconName} from 'sentry/components/events/contexts/utils'; -const PLATFORM_ALIASES = { - ios: 'apple', - mac: 'apple', - macos: 'apple', - 'mac-os-x': 'apple', - darwin: 'apple', - tvos: 'apple-tv', - watchos: 'apple-watch', - iphone: 'apple-iphone', - ipad: 'apple-ipad', - 'legacy-edge': 'edge-legacy', - 'mobile-safari': 'safari', - 'chrome-mobile-ios': 'chrome', - 'google-chrome': 'chrome', - 'chrome-os': 'chrome', - net: 'dotnet', - 'net-core': 'dotnetcore', - 'net-framework': 'dotnetframework', -}; - /** * Generates names used for PlatformIcon. Translates ContextIcon names (https://sentry.sentry.io/stories/stories/shared/components/events/contexts/contexticon) to PlatformIcon (https://www.npmjs.com/package/platformicons) names */ @@ -27,7 +8,5 @@ export function generatePlatformIconName( name: string, version: string | undefined ): string { - const contextName = generateIconName(name, version); - // @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message - return contextName in PLATFORM_ALIASES ? PLATFORM_ALIASES[contextName] : contextName; + return getLogoImage(generateIconName(name, version)) ?? 'default'; }