1
- import React , { useContext , useState } from 'react'
1
+ import React , { useState } from 'react'
2
2
import { ChartListPopUpType } from '../charts.types'
3
3
import {
4
4
showError ,
@@ -16,15 +16,14 @@ import { toast } from 'react-toastify'
16
16
import { EMPTY_STATE_STATUS , TOAST_INFO } from '../../../config/constantMessaging'
17
17
import { reSyncChartRepo } from '../../chartRepo/chartRepo.service'
18
18
import { ReactComponent as Help } from '../../../assets/icons/ic-help.svg'
19
- import { NavLink , useHistory } from 'react-router-dom'
20
- import { SERVER_MODE , URLS } from '../../../config'
19
+ import { NavLink } from 'react-router-dom'
20
+ import { URLS } from '../../../config'
21
21
import { ReactComponent as Add } from '../../../assets/icons/ic-add.svg'
22
22
import EmptyFolder from '../../../assets/img/Empty-folder.png'
23
23
import NoResults from '../../../assets/img/[email protected] '
24
24
import AddChartSource from './AddChartSource'
25
25
import ChartListPopUpRow from './ChartListPopUpRow'
26
26
import { ReactComponent as SyncIcon } from '../../../assets/icons/ic-arrows_clockwise.svg'
27
- import { mainContext } from '../../common/navigation/NavigationRoutes'
28
27
29
28
function ChartListPopUp ( {
30
29
onClose,
@@ -34,13 +33,11 @@ function ChartListPopUp({
34
33
setFilteredChartList,
35
34
setShowSourcePopoUp,
36
35
} : ChartListPopUpType ) {
37
- const { serverMode } = useContext ( mainContext )
38
36
const [ searchApplied , setSearchApplied ] = useState < boolean > ( false )
39
37
const [ searchText , setSearchText ] = useState < string > ( '' )
40
38
const [ fetching , setFetching ] = useState < boolean > ( false )
41
39
const [ showAddPopUp , setShowAddPopUp ] = useState < boolean > ( false )
42
40
const isEmpty = chartList . length && ! filteredChartList . length
43
- const history = useHistory ( )
44
41
45
42
const setStore = ( event ) : void => {
46
43
setSearchText ( event . target . value )
0 commit comments