@@ -12,6 +12,8 @@ import passingMark from "../../assets/images/landscape/passing.svg";
1212import failingMark from "../../assets/images/landscape/failing.svg" ;
1313import ServiceMeshIcon from "../../assets/images/service-mesh-icons/service-mesh.svg" ;
1414
15+ const TOOLTIP_ID = "smi-table-tooltip" ;
16+
1517// const halfMark = "../../assets/images/landscape/half.svg";
1618// const passingMark = "../../assets/images/landscape/passing.svg";
1719// const failingMark = "../../assets/images/landscape/failing.svg";
@@ -33,43 +35,27 @@ const TableRow = React.memo(({ row, rowIndex, prepareRow }) => {
3335 < td >
3436 {
3537 ( non_functional . find ( ele => ele . name . includes ( row . original . mesh_name ) ) ) ?
36- < >
37- < img data-tooltip-id = "react-tooltip" data-tooltip-content = { row . original . mesh_name } className = "smiMark" src = { non_functional . find ( ele => ele . name . includes ( row . original . mesh_name ) ) . icon } alt = "Mesh Icon" />
38- < Tooltip
39- id = "react-tooltip"
40- place = "bottom"
41- style = { { backgroundColor : "rgb(60,73,79)" } }
42- className = "smi-tooltip"
43- />
44- </ >
45- : < >
46- < img data-tooltip-id = "react-tooltip" data-tooltip-content = { "Service Mesh" } className = "smiMark" src = { ServiceMeshIcon } alt = "Service Mesh" />
47- < Tooltip
48- id = "react-tooltip"
49- place = "bottom"
50- style = { { backgroundColor : "rgb(60,73,79)" } }
51- className = "smi-tooltip"
52- />
53- </ >
38+ < img data-tooltip-id = { TOOLTIP_ID } data-tooltip-content = { row . original . mesh_name } className = "smiMark" src = { non_functional . find ( ele => ele . name . includes ( row . original . mesh_name ) ) . icon } alt = "Mesh Icon" />
39+ : < img data-tooltip-id = { TOOLTIP_ID } data-tooltip-content = { "Service Mesh" } className = "smiMark" src = { ServiceMeshIcon } alt = "Service Mesh" />
5440 }
5541 </ td >
5642 < td > { row . original . mesh_version } </ td >
5743 { row . original . more_details . map ( ( spec , index ) => {
5844 if ( spec [ "capability" ] === "FULL" ) {
5945 return < td key = { `spec${ index } ` } >
60- < div className = "tooltip-div" data-tooltip-id = "react-tooltip" data-tooltip-content = { `${ spec [ "result" ] } ` } >
46+ < div className = "tooltip-div" data-tooltip-id = { TOOLTIP_ID } data-tooltip-content = { `${ spec [ "result" ] } ` } >
6147 < img className = "smiMark" src = { passingMark } alt = "Pass Mark" />
6248 </ div >
6349 </ td > ;
6450 } else if ( spec [ "capability" ] === "HALF" ) {
6551 return < td key = { `spec${ index } ` } >
66- < div className = "tooltip-div" data-tooltip-id = "react-tooltip" data-tooltip-content = { `${ spec [ "reason" ] } <br>${ spec [ "result" ] } ` } >
52+ < div className = "tooltip-div" data-tooltip-id = { TOOLTIP_ID } data-tooltip-content = { `${ spec [ "reason" ] } <br>${ spec [ "result" ] } ` } >
6753 < img className = "smiMark" src = { halfMark } alt = "Half Mark" />
6854 </ div >
6955 </ td > ;
7056 } else if ( spec [ "capability" ] === "NONE" ) {
7157 return < td key = { `spec${ index } ` } >
72- < div className = "tooltip-div" data-tooltip-id = "react-tooltip" data-tooltip-content = { `${ spec [ "reason" ] } <br>${ spec [ "result" ] } ` } >
58+ < div className = "tooltip-div" data-tooltip-id = { TOOLTIP_ID } data-tooltip-content = { `${ spec [ "reason" ] } <br>${ spec [ "result" ] } ` } >
7359 < img className = "smiMark" src = { failingMark } alt = "Fail Mark" />
7460 </ div >
7561 </ td > ;
@@ -158,6 +144,12 @@ const Table = ({ columns, data, spec }) => {
158144 } ) }
159145 </ tbody >
160146 </ table >
147+ < Tooltip
148+ id = { TOOLTIP_ID }
149+ place = "bottom"
150+ style = { { backgroundColor : "rgb(60,73,79)" } }
151+ className = "smi-tooltip"
152+ />
161153 </ TableWrapper >
162154 ) ;
163155} ;
0 commit comments