1
- import { connect } from 'react-redux' ;
2
- import { Link } from 'react-router-dom' ;
3
- import cn from 'bem-cn-lite' ;
4
- import { useLocation } from 'react-router' ;
5
1
import qs from 'qs' ;
6
- import _ from 'lodash' ;
2
+ import { useLocation } from 'react-router' ;
3
+ import cn from 'bem-cn-lite' ;
4
+
5
+ import { useThemeValue } from '@yandex-cloud/uikit' ;
6
+
7
+ import type { EPathType } from '../../../types/api/schema' ;
7
8
8
- import { Tabs , useThemeValue } from '@yandex-cloud/uikit' ;
9
- //@ts -ignore
10
9
import QueryEditor from '../QueryEditor/QueryEditor' ;
11
10
import Diagnostics from '../Diagnostics/Diagnostics' ;
12
11
13
- import { TenantGeneralTabsIds , TenantTabsGroups , TENANT_GENERAL_TABS } from '../TenantPages' ;
14
- import routes , { createHref } from '../../../routes' ;
15
- import { setSettingValue } from '../../../store/reducers/settings' ;
16
- import { TENANT_INITIAL_TAB_KEY } from '../../../utils/constants' ;
17
- import type { EPathType } from '../../../types/api/schema' ;
12
+ import { TenantGeneralTabsIds } from '../TenantPages' ;
18
13
19
14
import './ObjectGeneral.scss' ;
20
15
@@ -24,7 +19,6 @@ interface ObjectGeneralProps {
24
19
type ?: EPathType ;
25
20
additionalTenantInfo ?: any ;
26
21
additionalNodesInfo ?: any ;
27
- setSettingValue : ( name : string , value : string ) => void ;
28
22
}
29
23
30
24
function ObjectGeneral ( props : ObjectGeneralProps ) {
@@ -38,32 +32,6 @@ function ObjectGeneral(props: ObjectGeneralProps) {
38
32
39
33
const { name : tenantName , general : generalTab } = queryParams ;
40
34
41
- const renderTabs = ( ) => {
42
- return (
43
- < div className = { b ( 'tabs' ) } >
44
- < Tabs
45
- size = "xl"
46
- items = { TENANT_GENERAL_TABS }
47
- activeTab = { generalTab as string }
48
- wrapTo = { ( { id} , node ) => {
49
- const path = createHref ( routes . tenant , undefined , {
50
- ...queryParams ,
51
- name : tenantName as string ,
52
- [ TenantTabsGroups . general ] : id ,
53
- } ) ;
54
- return (
55
- < Link to = { path } key = { id } className = { b ( 'tab' ) } >
56
- { node }
57
- </ Link >
58
- ) ;
59
- } }
60
- allowNotSelected
61
- onSelectTab = { ( id ) => props . setSettingValue ( TENANT_INITIAL_TAB_KEY , id ) }
62
- />
63
- </ div >
64
- ) ;
65
- } ;
66
-
67
35
const renderTabContent = ( ) => {
68
36
const { type, additionalTenantInfo, additionalNodesInfo} = props ;
69
37
switch ( generalTab ) {
@@ -88,7 +56,6 @@ function ObjectGeneral(props: ObjectGeneralProps) {
88
56
}
89
57
return (
90
58
< div className = { b ( ) } >
91
- { renderTabs ( ) }
92
59
{ renderTabContent ( ) }
93
60
</ div >
94
61
) ;
@@ -97,8 +64,4 @@ function ObjectGeneral(props: ObjectGeneralProps) {
97
64
return renderContent ( ) ;
98
65
}
99
66
100
- const mapDispatchToProps = {
101
- setSettingValue,
102
- } ;
103
-
104
- export default connect ( null , mapDispatchToProps ) ( ObjectGeneral ) ;
67
+ export default ObjectGeneral ;
0 commit comments