1
1
import React , { ReactNode } from 'react'
2
- import { useDispatch , useSelector } from 'react-redux'
3
2
4
3
import { DatabaseAnalysisViewTab } from 'uiSrc/slices/interfaces/analytics'
5
- import {
6
- appFeatureHighlightingSelector ,
7
- removeFeatureFromHighlighting
8
- } from 'uiSrc/slices/app/features'
9
- import { BUILD_FEATURES } from 'uiSrc/constants/featuresHighlighting'
10
- import HighlightedFeature from 'uiSrc/components/hightlighted-feature/HighlightedFeature'
11
-
12
- import { getHighlightingFeatures } from 'uiSrc/utils/highlighting'
13
4
import { OnboardingTourOptions } from 'uiSrc/components/onboarding-tour'
14
5
import { ONBOARDING_FEATURES } from 'uiSrc/components/onboarding-features'
15
6
@@ -23,25 +14,6 @@ interface DatabaseAnalysisTabs {
23
14
onboard ?: OnboardingTourOptions
24
15
}
25
16
26
- const RecommendationsTab = ( { count } : { count ?: number } ) => {
27
- const { features } = useSelector ( appFeatureHighlightingSelector )
28
- const { recommendations : recommendationsHighlighting } = getHighlightingFeatures ( features )
29
-
30
- const dispatch = useDispatch ( )
31
-
32
- return (
33
- < HighlightedFeature
34
- type = "plain"
35
- isHighlight = { BUILD_FEATURES . recommendations && recommendationsHighlighting }
36
- onClick = { ( ) => dispatch ( removeFeatureFromHighlighting ( 'recommendations' ) ) }
37
- dotClassName = "tab-highlighting-dot"
38
- wrapperClassName = "inner-highlighting-wrapper"
39
- >
40
- { count ? < > Recommendations ({ count } )</ > : < > Recommendations</ > }
41
- </ HighlightedFeature >
42
- )
43
- }
44
-
45
17
export const databaseAnalysisTabs : DatabaseAnalysisTabs [ ] = [
46
18
{
47
19
id : DatabaseAnalysisViewTab . DataSummary ,
@@ -50,7 +22,7 @@ export const databaseAnalysisTabs: DatabaseAnalysisTabs[] = [
50
22
} ,
51
23
{
52
24
id : DatabaseAnalysisViewTab . Recommendations ,
53
- name : ( count ) => < RecommendationsTab count = { count } /> ,
25
+ name : ( count ?: number ) => ( count ? `Recommendations ( $ {count } )` : 'Recommendations' ) ,
54
26
content : < Recommendations /> ,
55
27
onboard : ONBOARDING_FEATURES . ANALYTICS_RECOMMENDATIONS
56
28
} ,
0 commit comments