File tree Expand file tree Collapse file tree
frontend/src/cmk-stubs/CmkIcon Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 */
1010import type { IconNames } from 'cmk-shared-typing/typescript/icon'
1111
12+ import copiedIconUrl from './icon_copied.svg'
1213import { iconSizes , themedIcons , unthemedIcons } from './icons.constants'
1314
15+ // Icons that older Checkmk themes don't ship (icon_copied.svg only exists
16+ // from 2.5 on) are bundled so they render on every supported version.
17+ const bundledIcons : Partial < Record < IconNames , string > > = {
18+ copied : copiedIconUrl
19+ }
20+
1421type IconSizeNames = keyof typeof iconSizes
1522type SimpleIcons = IconNames
1623
@@ -38,6 +45,11 @@ function checkmkBase(): string {
3845}
3946
4047export function getIconPath ( name : SimpleIcons , theme : string ) : string {
48+ const bundled = bundledIcons [ name ]
49+ if ( bundled ) {
50+ return bundled
51+ }
52+
4153 const internalTheme = theme === 'facelift' ? 'light' : 'dark'
4254
4355 const themedPath = themedIcons [ internalTheme ] ?. [ name ]
You can’t perform that action at this time.
0 commit comments