@@ -4,13 +4,14 @@ import { Icon } from '@harnessio/icons';
44import { FontVariation , Color } from '@harnessio/design-system' ;
55import { Link , useParams } from 'react-router-dom' ;
66import { withErrorBoundary } from 'react-error-boundary' ;
7- import { toTitleCase } from '@utils' ;
7+ import { toTitleCase , getScope } from '@utils' ;
88import { useStrings } from '@strings' ;
99import NoExperiments from '@images/NoExperiments.svg' ;
1010import { Fallback } from '@errors' ;
1111import Loader from '@components/Loader' ;
1212import { useSearchParams , useRouteWithBaseUrl } from '@hooks' ;
1313import type { ListFaultResponse } from '@api/core' ;
14+ import config from '@config' ;
1415import css from './ChaosFaults.module.scss' ;
1516
1617interface ChaosFaultsProps {
@@ -41,6 +42,7 @@ function ChaosFaults({ hubDetails, faultCategories, loading, searchValue }: Chao
4142 const searchParams = useSearchParams ( ) ;
4243 const hubName = searchParams . get ( 'hubName' ) ;
4344 const isDefault = searchParams . get ( 'isDefault' ) ;
45+ const scope = getScope ( ) ;
4446 const tags : TagProps [ ] = [ ] ;
4547 const faultsArray : Fault [ ] = [ ] ;
4648 const [ activeTag , setActiveTag ] = React . useState < string > ( 'All' ) ;
@@ -99,7 +101,19 @@ function ChaosFaults({ hubDetails, faultCategories, loading, searchValue }: Chao
99101 < Card key = { fault . name } interactive className = { css . insideCard } >
100102 < Layout . Vertical spacing = "medium" >
101103 < Layout . Horizontal spacing = "small" >
102- < Icon size = { 23 } name = "chaos-litmuschaos" />
104+ { fault . chartName . toLowerCase ( ) === 'kubernetes' ? (
105+ < img
106+ src = {
107+ isDefault === 'true'
108+ ? `${ config . restEndpoints ?. chaosManagerUri } /icon/default/${ hubName } /${ fault . chartName } /${ fault . name } .png`
109+ : `${ config . restEndpoints ?. chaosManagerUri } /icon/${ scope . projectID } /${ hubName } /${ fault . chartName } /${ fault . name } .png`
110+ }
111+ alt = { `${ fault . name } icon` }
112+ style = { { width : 23 , height : 23 } }
113+ />
114+ ) : (
115+ < Icon size = { 23 } name = "chaos-litmuschaos" />
116+ ) }
103117 < Text font = { { variation : FontVariation . BODY , weight : 'semi-bold' } } color = { Color . PRIMARY_7 } >
104118 { fault . displayName === ''
105119 ? toTitleCase ( {
0 commit comments