@@ -14,7 +14,6 @@ import {
1414 EuiTableRow ,
1515 EuiTableRowCell ,
1616} from "@elastic/eui" ;
17- import useLoadRegularFeatureView from "../../pages/feature-views/useLoadFeatureView" ;
1817import DataQuery from "./DataQuery" ;
1918
2019const FeatureViewDataRow = z . object ( {
@@ -26,29 +25,25 @@ type FeatureViewDataRowType = z.infer<typeof FeatureViewDataRow>;
2625
2726const LineHeightProp : React . CSSProperties = {
2827 lineHeight : 1 ,
29- }
28+ } ;
3029
31- const EuiFeatureViewDataRow = ( { name, value} : FeatureViewDataRowType ) => {
30+ const EuiFeatureViewDataRow = ( { name, value } : FeatureViewDataRowType ) => {
3231 return (
3332 < EuiTableRow >
34- < EuiTableRowCell >
35- { name }
36- </ EuiTableRowCell >
33+ < EuiTableRowCell > { name } </ EuiTableRowCell >
3734 < EuiTableRowCell textOnly = { false } >
3835 < EuiCode data-code-language = "text" >
39- < pre style = { LineHeightProp } >
40- { value }
41- </ pre >
36+ < pre style = { LineHeightProp } > { value } </ pre >
4237 </ EuiCode >
4338 </ EuiTableRowCell >
4439 </ EuiTableRow >
4540 ) ;
46- }
41+ } ;
4742
4843const FeatureViewDataTable = ( data : any ) => {
4944 var items : FeatureViewDataRowType [ ] = [ ] ;
5045
51- for ( let element in data . data ) {
46+ for ( let element in data . data ) {
5247 const row : FeatureViewDataRowType = {
5348 name : element ,
5449 value : JSON . stringify ( data . data [ element ] , null , 2 ) ,
@@ -60,48 +55,44 @@ const FeatureViewDataTable = (data: any) => {
6055 return (
6156 < EuiTable >
6257 < 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 >
6960 </ EuiTableHeader >
7061 { items . map ( ( item ) => {
71- return < EuiFeatureViewDataRow name = { item . name } value = { item . value } />
62+ return < EuiFeatureViewDataRow name = { item . name } value = { item . value } /> ;
7263 } ) }
7364 </ EuiTable >
74- )
75- }
65+ ) ;
66+ } ;
7667
7768const DataTab = ( ) => {
78- const fName = "credit_history"
69+ const fName = "credit_history" ;
7970 const { isLoading, isError, isSuccess, data } = DataQuery ( fName ) ;
8071 const isEmpty = data === undefined ;
8172
8273 return (
8374 < 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 >
10596 ) }
10697 </ React . Fragment >
10798 ) ;
0 commit comments