1
1
import React , { useEffect } from 'react'
2
- import cx from 'classnames'
3
-
4
2
import { useDispatch , useSelector } from 'react-redux'
5
3
import { useLocation , useParams } from 'react-router-dom'
4
+
6
5
import {
7
6
changeSelectedTab ,
8
7
changeSidePanel ,
@@ -23,10 +22,14 @@ import {
23
22
} from 'uiSrc/telemetry'
24
23
import { connectedInstanceSelector } from 'uiSrc/slices/instances/instances'
25
24
26
- import { IconButton } from 'uiSrc/components/base/forms/buttons'
27
25
import { LightBulbIcon } from 'uiSrc/components/base/icons'
28
26
import { RiTooltip } from 'uiSrc/components'
29
- import styles from './styles.module.scss'
27
+
28
+ import {
29
+ BulbHighlighting ,
30
+ BulbIconButton ,
31
+ BulbWrapper ,
32
+ } from './insights-trigger.styles'
30
33
31
34
export interface Props {
32
35
source ?: string
@@ -79,29 +82,26 @@ const InsightsTrigger = (props: Props) => {
79
82
}
80
83
81
84
return (
82
- < div className = { cx ( styles . container , { [ styles . isOpen ] : isInsightsOpen } ) } >
83
- < RiTooltip
84
- title = { isHighlighted && instanceId ? undefined : 'Insights' }
85
- content = {
86
- isHighlighted && instanceId
87
- ? 'New tips are available '
88
- : 'Open interactive tutorials to learn more about Redis or Redis Stack capabilities, or use tips to improve your database.'
89
- }
90
- >
91
- < IconButton
85
+ < RiTooltip
86
+ title = { isHighlighted && instanceId ? undefined : 'Insights' }
87
+ content = {
88
+ isHighlighted && instanceId
89
+ ? 'New tips are available'
90
+ : 'Open interactive tutorials to learn more about Redis or Redis Stack capabilities, or use tips to improve your database. '
91
+ }
92
+ >
93
+ < BulbWrapper >
94
+ < BulbIconButton
92
95
size = "S"
93
- className = { styles . btn }
94
96
role = "button"
95
97
icon = { LightBulbIcon }
96
98
onClick = { handleClickTrigger }
97
99
data-testid = "insights-trigger"
98
- >
99
- { isHighlighted && instanceId && (
100
- < span className = { styles . highlighting } />
101
- ) }
102
- </ IconButton >
103
- </ RiTooltip >
104
- </ div >
100
+ isOpen = { isInsightsOpen }
101
+ />
102
+ { isHighlighted && instanceId && < BulbHighlighting /> }
103
+ </ BulbWrapper >
104
+ </ RiTooltip >
105
105
)
106
106
}
107
107
0 commit comments