@@ -14,7 +14,6 @@ import {
14
14
EuiTableRow ,
15
15
EuiTableRowCell ,
16
16
} from "@elastic/eui" ;
17
- import useLoadRegularFeatureView from "../../pages/feature-views/useLoadFeatureView" ;
18
17
import DataQuery from "./DataQuery" ;
19
18
20
19
const FeatureViewDataRow = z . object ( {
@@ -26,29 +25,25 @@ type FeatureViewDataRowType = z.infer<typeof FeatureViewDataRow>;
26
25
27
26
const LineHeightProp : React . CSSProperties = {
28
27
lineHeight : 1 ,
29
- }
28
+ } ;
30
29
31
- const EuiFeatureViewDataRow = ( { name, value} : FeatureViewDataRowType ) => {
30
+ const EuiFeatureViewDataRow = ( { name, value } : FeatureViewDataRowType ) => {
32
31
return (
33
32
< EuiTableRow >
34
- < EuiTableRowCell >
35
- { name }
36
- </ EuiTableRowCell >
33
+ < EuiTableRowCell > { name } </ EuiTableRowCell >
37
34
< EuiTableRowCell textOnly = { false } >
38
35
< EuiCode data-code-language = "text" >
39
- < pre style = { LineHeightProp } >
40
- { value }
41
- </ pre >
36
+ < pre style = { LineHeightProp } > { value } </ pre >
42
37
</ EuiCode >
43
38
</ EuiTableRowCell >
44
39
</ EuiTableRow >
45
40
) ;
46
- }
41
+ } ;
47
42
48
43
const FeatureViewDataTable = ( data : any ) => {
49
44
var items : FeatureViewDataRowType [ ] = [ ] ;
50
45
51
- for ( let element in data . data ) {
46
+ for ( let element in data . data ) {
52
47
const row : FeatureViewDataRowType = {
53
48
name : element ,
54
49
value : JSON . stringify ( data . data [ element ] , null , 2 ) ,
@@ -60,48 +55,44 @@ const FeatureViewDataTable = (data: any) => {
60
55
return (
61
56
< EuiTable >
62
57
< EuiTableHeader >
63
- < EuiTableHeaderCell >
64
- Data Item Name
65
- </ EuiTableHeaderCell >
66
- < EuiTableHeaderCell >
67
- Data Item Value
68
- </ EuiTableHeaderCell >
58
+ < EuiTableHeaderCell > Data Item Name</ EuiTableHeaderCell >
59
+ < EuiTableHeaderCell > Data Item Value</ EuiTableHeaderCell >
69
60
</ EuiTableHeader >
70
61
{ items . map ( ( item ) => {
71
- return < EuiFeatureViewDataRow name = { item . name } value = { item . value } />
62
+ return < EuiFeatureViewDataRow name = { item . name } value = { item . value } /> ;
72
63
} ) }
73
64
</ EuiTable >
74
- )
75
- }
65
+ ) ;
66
+ } ;
76
67
77
68
const DataTab = ( ) => {
78
- const fName = "credit_history"
69
+ const fName = "credit_history" ;
79
70
const { isLoading, isError, isSuccess, data } = DataQuery ( fName ) ;
80
71
const isEmpty = data === undefined ;
81
72
82
73
return (
83
74
< React . Fragment >
84
- { isLoading && (
85
- < React . Fragment >
86
- < EuiLoadingSpinner size = "m" /> Loading
87
- </ React . Fragment >
88
- ) }
89
- { isEmpty && < p > No feature view with name: { fName } </ p > }
90
- { isError && < p > Error loading feature view: { fName } </ p > }
91
- { isSuccess && data && (
92
- < React . Fragment >
93
- < EuiFlexGroup >
94
- < EuiFlexItem >
95
- < EuiPanel hasBorder = { true } >
96
- < EuiTitle size = "xs" >
97
- < h3 > Properties</ h3 >
98
- </ EuiTitle >
99
- < EuiHorizontalRule margin = "xs" />
100
- < FeatureViewDataTable data = { data } />
101
- </ EuiPanel >
102
- </ EuiFlexItem >
103
- </ EuiFlexGroup >
104
- </ React . Fragment >
75
+ { isLoading && (
76
+ < React . Fragment >
77
+ < EuiLoadingSpinner size = "m" /> Loading
78
+ </ React . Fragment >
79
+ ) }
80
+ { isEmpty && < p > No feature view with name: { fName } </ p > }
81
+ { isError && < p > Error loading feature view: { fName } </ p > }
82
+ { isSuccess && data && (
83
+ < React . Fragment >
84
+ < EuiFlexGroup >
85
+ < EuiFlexItem >
86
+ < EuiPanel hasBorder = { true } >
87
+ < EuiTitle size = "xs" >
88
+ < h3 > Properties</ h3 >
89
+ </ EuiTitle >
90
+ < EuiHorizontalRule margin = "xs" />
91
+ < FeatureViewDataTable data = { data } />
92
+ </ EuiPanel >
93
+ </ EuiFlexItem >
94
+ </ EuiFlexGroup >
95
+ </ React . Fragment >
105
96
) }
106
97
</ React . Fragment >
107
98
) ;
0 commit comments