@@ -139,12 +139,16 @@ const ApiConfigPanel: React.FC<ApiConfigPanelProps> = ({
139139
140140 // Calculate overall status
141141 const getOverallStatus = ( ) => {
142- if ( healthLoading || stacApis . length === 0 ) {
143- return { color : "gray" , status : "Unknown" , hasIssues : false } ;
142+ if ( healthLoading ) {
143+ return { color : "gray" , status : "Checking" , isLoading : true , hasIssues : false } ;
144+ }
145+
146+ if ( stacApis . length === 0 ) {
147+ return { color : "gray" , status : "Unknown" , isLoading : false , hasIssues : false } ;
144148 }
145149
146150 if ( ! healthData ) {
147- return { color : "red" , status : "Error" , hasIssues : true } ;
151+ return { color : "red" , status : "Error" , isLoading : false , hasIssues : true } ;
148152 }
149153
150154 const isHealthy = healthData . status === "UP" ;
@@ -158,17 +162,17 @@ const ApiConfigPanel: React.FC<ApiConfigPanelProps> = ({
158162 ) ;
159163
160164 if ( ! isHealthy || apisLackingCollectionSearch . length > 0 ) {
161- return { color : "red" , status : "Issues" , hasIssues : true } ;
165+ return { color : "red" , status : "Issues" , isLoading : false , hasIssues : true } ;
162166 }
163167
164168 if ( apisLackingFreeText . length > 0 ) {
165- return { color : "orange" , status : "Limited" , hasIssues : true } ;
169+ return { color : "orange" , status : "Limited" , isLoading : false , hasIssues : true } ;
166170 }
167171
168- return { color : "green" , status : "Healthy" , hasIssues : false } ;
172+ return { color : "green" , status : "Healthy" , isLoading : false , hasIssues : false } ;
169173 } ;
170174
171- const { color, status, hasIssues } = getOverallStatus ( ) ;
175+ const { color, status, isLoading , hasIssues } = getOverallStatus ( ) ;
172176
173177 // API management functions
174178 const validateUrl = ( url : string ) : boolean => {
@@ -271,12 +275,16 @@ const ApiConfigPanel: React.FC<ApiConfigPanelProps> = ({
271275 border = "1px solid"
272276 borderColor = "gray.200"
273277 >
274- < Box
275- width = "12px"
276- height = "12px"
277- bg = { `${ color } .500` }
278- borderRadius = "50%"
279- />
278+ { isLoading ? (
279+ < Spinner size = "sm" color = { `${ color } .500` } />
280+ ) : (
281+ < Box
282+ width = "12px"
283+ height = "12px"
284+ bg = { `${ color } .500` }
285+ borderRadius = "50%"
286+ />
287+ ) }
280288 < Text fontWeight = "medium" flex = { 1 } >
281289 { stacApis . length } API{ stacApis . length !== 1 ? "s" : "" } configured •{ " " }
282290 { status }
0 commit comments