1
- import Typography from ' @mui/material/Typography' ;
2
- import FormGroup from ' @mui/material/FormGroup' ;
3
- import FormControlLabel from ' @mui/material/FormControlLabel' ;
4
- import Switch from ' @mui/material/Switch' ;
5
- import React , { useState } from ' react' ;
1
+ import Typography from " @mui/material/Typography" ;
2
+ import FormGroup from " @mui/material/FormGroup" ;
3
+ import FormControlLabel from " @mui/material/FormControlLabel" ;
4
+ import Switch from " @mui/material/Switch" ;
5
+ import React , { useState } from " react" ;
6
6
7
- import JsonDiff from ' ../components/JsonDiff' ;
7
+ import JsonDiff from " ../components/JsonDiff" ;
8
8
9
- import { DataTabProps } from ' ../types' ;
9
+ import { DataTabProps } from " ../types" ;
10
10
11
11
const DiffTab = ( { queryDisplay, currentIndex } : DataTabProps ) => {
12
12
// state to determine if unchanged are hidden or closed
@@ -22,21 +22,20 @@ const DiffTab = ({ queryDisplay, currentIndex }: DataTabProps) => {
22
22
return (
23
23
< >
24
24
< FormControlLabel
25
- sx = { { color : ' primary.main' , marginLeft : 0 } }
25
+ sx = { { color : " primary.main" , marginLeft : 0 } }
26
26
control = {
27
27
< Switch checked = { isHidden } onChange = { toggleChangedProperties } />
28
28
}
29
- label = { `${ isHidden ? ' Show' : ' Hide' } Unchanged Properties ` }
29
+ label = { `${ isHidden ? " Show" : " Hide" } Unchanged Properties ` }
30
30
/>
31
31
{ queryDisplay . length > 0 && queryDisplay [ currentIndex ] && (
32
- < div className = ' data' >
32
+ < div className = " data" >
33
33
{ queryDisplay [ currentIndex ] . map ( ( queryState , i ) => (
34
- < >
35
- < Typography variant = 'h6' sx = { { color : ' secondary.main' } } >
34
+ < React . Fragment key = { queryState . queryKey } >
35
+ < Typography variant = "h6" sx = { { color : " secondary.main" } } >
36
36
{ queryState . queryKey }
37
37
</ Typography >
38
38
< JsonDiff
39
- key = { queryState . queryKey }
40
39
currentJson = { queryState . queryData }
41
40
isHidden = { isHidden }
42
41
oldJson = {
@@ -47,7 +46,7 @@ const DiffTab = ({ queryDisplay, currentIndex }: DataTabProps) => {
47
46
: null
48
47
}
49
48
/>
50
- </ >
49
+ </ React . Fragment >
51
50
) ) }
52
51
</ div >
53
52
) }
0 commit comments