@@ -27,15 +27,22 @@ const Result: React.FC<LayoutProps> = ({
27
27
{ status }
28
28
< div className = "flex justify-between" >
29
29
< b > Execution duration (μs): </ b >
30
- < div className = { execDuration == null || execDuration === 0 ? "animate-pulse h w-48 bg-gray-800 rounded-lg text-white text-cente" : "h w-48 bg-gray-800 rounded-lg text-white text-cente" } > { execDuration === 0 ? null : execDuration } </ div >
30
+ < div
31
+ className = {
32
+ execDuration == null || execDuration === 0
33
+ ? 'animate-pulse h w-48 bg-gray-800 rounded-lg text-white text-cente'
34
+ : 'h w-48 bg-gray-800 rounded-lg text-white text-cente'
35
+ }
36
+ >
37
+ { execDuration === 0 ? null : execDuration }
38
+ </ div >
31
39
</ div >
32
- < OutputsComponent text = { "Message" } value = { message } />
33
- < OutputsComponent text = { "Error" } value = { error } />
34
- < OutputsComponent text = { "Stdout" } value = { stdout } />
35
- < OutputsComponent text = { "Stderr" } value = { stderr } />
36
-
37
- < ScoresComponent qualityScore = { qualityScore } lintScore = { lintScore } />
40
+ < OutputsComponent text = { 'Message' } value = { message } />
41
+ < OutputsComponent text = { 'Error' } value = { error } />
42
+ < OutputsComponent text = { 'Stdout' } value = { stdout } />
43
+ < OutputsComponent text = { 'Stderr' } value = { stderr } />
38
44
45
+ < ScoresComponent qualityScore = { qualityScore } lintScore = { lintScore } />
39
46
</ div >
40
47
) ;
41
48
} ;
@@ -45,64 +52,87 @@ interface OutputsComponentProps {
45
52
value ?: string ;
46
53
}
47
54
48
- const OutputsComponent : React . FC < OutputsComponentProps > = ( { text, value} ) => {
49
- return (
55
+ const OutputsComponent : React . FC < OutputsComponentProps > = ( { text, value } ) => {
56
+ return (
50
57
< div >
51
58
< b > { text } :</ b >
52
- < div className = { value == null ? "animate-pulse h-10 w-full bg-gray-800 rounded-lg text-white" : "h-10 w-full bg-gray-800 rounded-lg text-white" } > { value } </ div >
59
+ < div
60
+ className = {
61
+ value == null
62
+ ? 'animate-pulse h-10 w-full bg-gray-800 rounded-lg text-white'
63
+ : 'h-10 w-full bg-gray-800 rounded-lg text-white'
64
+ }
65
+ >
66
+ { value }
67
+ </ div >
53
68
</ div >
54
69
) ;
55
- }
70
+ } ;
56
71
57
72
interface ScoresComponentProps {
58
- qualityScore : number | undefined ,
59
- lintScore : number | undefined ,
73
+ qualityScore : number | undefined ;
74
+ lintScore : number | undefined ;
60
75
}
61
76
62
- const ScoresComponent : React . FC < ScoresComponentProps > = ( { qualityScore, lintScore} ) => {
63
-
64
- return (
77
+ const ScoresComponent : React . FC < ScoresComponentProps > = ( {
78
+ qualityScore,
79
+ lintScore,
80
+ } ) => {
81
+ return (
65
82
< div className = "relative flex flex-col min-w-0 mb-4 lg:mb-0 break-words bg-gray-50 dark:bg-gray-800 w-full shadow-lg rounded" >
66
83
< div className = "rounded-t mb-0 px-0 border-0" >
67
84
< div className = "flex flex-wrap items-center px-4 py-2" >
68
85
< div className = "relative w-full max-w-full flex-grow flex-1" >
69
- < h2 className = "font-semibold text-base text-gray-900 dark:text-gray-50" > Results</ h2 >
86
+ < h2 className = "font-semibold text-base text-gray-900 dark:text-gray-50" >
87
+ Results
88
+ </ h2 >
70
89
</ div >
71
90
</ div >
72
91
< div className = "block w-full overflow-x-auto" >
73
92
< table className = "items-center w-full bg-transparent border-collapse" >
74
93
< tbody >
75
- < tr className = "text-gray-700 dark:text-gray-100" >
76
- < th className = "border-t-0 px-4 align-middle border-l-0 border-r-0 text-xs whitespace-nowrap p-4 text-left" > Quality score</ th >
77
- < td className = "border-t-0 px-4 align-middle border-l-0 border-r-0 text-xs whitespace-nowrap p-4" >
78
- < div className = "flex items-center" >
79
- < span className = "mr-2" > { qualityScore } </ span >
80
- < div className = "relative w-full" >
81
- < div className = "overflow-hidden h-2 text-xs flex rounded bg-blue-200" >
82
- < div style = { { width : `${ qualityScore } %` } } className = 'shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-blue-600' />
94
+ < tr className = "text-gray-700 dark:text-gray-100" >
95
+ < th className = "border-t-0 px-4 align-middle border-l-0 border-r-0 text-xs whitespace-nowrap p-4 text-left" >
96
+ Quality score
97
+ </ th >
98
+ < td className = "border-t-0 px-4 align-middle border-l-0 border-r-0 text-xs whitespace-nowrap p-4" >
99
+ < div className = "flex items-center" >
100
+ < span className = "mr-2" > { qualityScore } </ span >
101
+ < div className = "relative w-full" >
102
+ < div className = "overflow-hidden h-2 text-xs flex rounded bg-blue-200" >
103
+ < div
104
+ style = { { width : `${ qualityScore } %` } }
105
+ className = "shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-blue-600"
106
+ />
107
+ </ div >
83
108
</ div >
84
109
</ div >
85
- </ div >
86
- </ td >
87
- </ tr >
88
- < tr className = "text-gray-700 dark:text-gray-100" >
89
- < th className = "border-t-0 px-4 align-middle border-l-0 border-r-0 text-xs whitespace-nowrap p-4 text-left" > Lint score</ th >
90
- < td className = "border-t-0 px-4 align-middle border-l-0 border-r-0 text-xs whitespace-nowrap p-4" >
91
- < div className = "flex items-center" >
92
- < span className = "mr-2" > { lintScore } </ span >
93
- < div className = "relative w-full" >
94
- < div className = "overflow-hidden h-2 text-xs flex rounded bg-blue-200" >
95
- < div style = { { width : `${ lintScore } %` } } className = 'shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-blue-500' />
110
+ </ td >
111
+ </ tr >
112
+ < tr className = "text-gray-700 dark:text-gray-100" >
113
+ < th className = "border-t-0 px-4 align-middle border-l-0 border-r-0 text-xs whitespace-nowrap p-4 text-left" >
114
+ Lint score
115
+ </ th >
116
+ < td className = "border-t-0 px-4 align-middle border-l-0 border-r-0 text-xs whitespace-nowrap p-4" >
117
+ < div className = "flex items-center" >
118
+ < span className = "mr-2" > { lintScore } </ span >
119
+ < div className = "relative w-full" >
120
+ < div className = "overflow-hidden h-2 text-xs flex rounded bg-blue-200" >
121
+ < div
122
+ style = { { width : `${ lintScore } %` } }
123
+ className = "shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-blue-500"
124
+ />
125
+ </ div >
96
126
</ div >
97
127
</ div >
98
- </ div >
99
- </ td >
100
- </ tr >
128
+ </ td >
129
+ </ tr >
101
130
</ tbody >
102
131
</ table >
103
132
</ div >
104
133
</ div >
105
- </ div > ) ;
106
- }
134
+ </ div >
135
+ ) ;
136
+ } ;
107
137
108
138
export default Result ;
0 commit comments