@@ -145,77 +145,76 @@ const PolicyGroup: React.FC<PolicyGroupProps> = ({
145
145
} , [ refreshSelection , isInViewport , selection ] )
146
146
147
147
return (
148
- < Card
149
- shadow = "single"
150
- ref = { targetRef }
151
- tw = "relative overflow-hidden px-3 md:px-4" >
152
- { isLoading && (
153
- < LoadingOverlay >
154
- < Spinner />
155
- </ LoadingOverlay >
156
- ) }
157
-
158
- < Heading
159
- size = "kilo"
160
- tw = "flex flex-row justify-between items-center mb-3 md:mb-4" >
161
- < div > { policyGroupName } </ div >
162
- < IconButton
148
+ < div ref = { targetRef } >
149
+ < Card shadow = "single" tw = "relative overflow-hidden px-3 md:px-4" >
150
+ { isLoading && (
151
+ < LoadingOverlay >
152
+ < Spinner />
153
+ </ LoadingOverlay >
154
+ ) }
155
+
156
+ < Heading
163
157
size = "kilo"
164
- label = "test policy"
165
- onClick = { ( ) => testPolicy ( policyGroupName ) } >
166
- { isTesting ? (
167
- < Spinner tw = "text-gray-700 w-5 h-5" />
168
- ) : (
169
- < Zap tw = "text-gray-700 w-5 h-5" />
170
- ) }
171
- </ IconButton >
172
- </ Heading >
173
-
174
- < div tw = "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3 md:gap-4" >
175
- { policyGroup . map ( ( policy ) => {
176
- return (
177
- < div
178
- css = { [
179
- tw `bg-gray-200 rounded-md px-3 py-3 md:px-4 md:py-3 cursor-pointer hover:bg-gray-300 transition-colors ease-in-out duration-200` ,
180
- selection === policy . name
181
- ? tw `bg-blue-600 text-white hover:bg-blue-600`
182
- : '' ,
183
- ] }
184
- key = { policy . name }
185
- onClick = { ( ) => selectPolicy ( policy . name ) } >
186
- < div tw = "text-sm md:text-base leading-snug" > { policy . name } </ div >
158
+ tw = "flex flex-row justify-between items-center mb-3 md:mb-4" >
159
+ < div > { policyGroupName } </ div >
160
+ < IconButton
161
+ size = "kilo"
162
+ label = "test policy"
163
+ onClick = { ( ) => testPolicy ( policyGroupName ) } >
164
+ { isTesting ? (
165
+ < Spinner tw = "text-gray-700 w-5 h-5" />
166
+ ) : (
167
+ < Zap tw = "text-gray-700 w-5 h-5" />
168
+ ) }
169
+ </ IconButton >
170
+ </ Heading >
171
+
172
+ < div tw = "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3 md:gap-4" >
173
+ { policyGroup . map ( ( policy ) => {
174
+ return (
187
175
< div
188
176
css = { [
189
- tw `flex flex-row justify-between mt-2 text-xs text-gray-700` ,
190
- selection === policy . name ? tw `text-white` : '' ,
191
- ] } >
192
- < div tw = "text-center bg-gray-400 text-gray-700 px-1 rounded" >
193
- { policy . typeDescription . toUpperCase ( ) }
177
+ tw `bg-gray-200 rounded-md px-3 py-3 md:px-4 md:py-3 cursor-pointer hover:bg-gray-300 transition-colors ease-in-out duration-200` ,
178
+ selection === policy . name
179
+ ? tw `bg-blue-600 text-white hover:bg-blue-600`
180
+ : '' ,
181
+ ] }
182
+ key = { policy . name }
183
+ onClick = { ( ) => selectPolicy ( policy . name ) } >
184
+ < div tw = "text-sm md:text-base leading-snug" > { policy . name } </ div >
185
+ < div
186
+ css = { [
187
+ tw `flex flex-row justify-between mt-2 text-xs text-gray-700` ,
188
+ selection === policy . name ? tw `text-white` : '' ,
189
+ ] } >
190
+ < div tw = "text-center bg-gray-400 text-gray-700 px-1 rounded" >
191
+ { policy . typeDescription . toUpperCase ( ) }
192
+ </ div >
193
+ { latencies [ policy . name ] >= 0 && (
194
+ < LatencyResult
195
+ css = { [
196
+ tw `rounded px-1` ,
197
+ latencyResultStyle ( latencies [ policy . name ] ) ,
198
+ ] } >
199
+ { latencies [ policy . name ] + 'ms' }
200
+ </ LatencyResult >
201
+ ) }
202
+ { latencies [ policy . name ] === - 1 && (
203
+ < LatencyResult
204
+ css = { [
205
+ tw `rounded px-1` ,
206
+ latencyResultStyle ( latencies [ policy . name ] ) ,
207
+ ] } >
208
+ Failed
209
+ </ LatencyResult >
210
+ ) }
194
211
</ div >
195
- { latencies [ policy . name ] >= 0 && (
196
- < LatencyResult
197
- css = { [
198
- tw `rounded px-1` ,
199
- latencyResultStyle ( latencies [ policy . name ] ) ,
200
- ] } >
201
- { latencies [ policy . name ] + 'ms' }
202
- </ LatencyResult >
203
- ) }
204
- { latencies [ policy . name ] === - 1 && (
205
- < LatencyResult
206
- css = { [
207
- tw `rounded px-1` ,
208
- latencyResultStyle ( latencies [ policy . name ] ) ,
209
- ] } >
210
- Failed
211
- </ LatencyResult >
212
- ) }
213
212
</ div >
214
- </ div >
215
- )
216
- } ) }
217
- </ div >
218
- </ Card >
213
+ )
214
+ } ) }
215
+ </ div >
216
+ </ Card >
217
+ </ div >
219
218
)
220
219
}
221
220
0 commit comments