@@ -359,24 +359,38 @@ export function prebuildStatusIcon(prebuild?: PrebuildWithStatus) {
359
359
}
360
360
}
361
361
362
- function prebuildStatusDescription ( prebuild : PrebuildWithStatus ) : string {
363
- switch ( prebuild ?. status ) {
364
- case undefined : // Fall through
362
+ function PrebuildStatusDescription ( props : { prebuild : PrebuildWithStatus } ) {
363
+ switch ( props . prebuild . status ) {
365
364
case "queued" :
366
- return " Prebuild is queued and will be processed when there is execution capacity." ;
365
+ return < span > Prebuild is queued and will be processed when there is execution capacity.</ span > ;
367
366
case "building" :
368
- return " Prebuild is currently in progress." ;
367
+ return < span > Prebuild is currently in progress.</ span > ;
369
368
case "aborted" :
370
- return "Prebuild has been cancelled. Either a user cancelled it, or the prebuild rate limit has been exceeded." ;
369
+ return (
370
+ < span >
371
+ Prebuild has been cancelled. Either a user cancelled it, or the prebuild rate limit has been
372
+ exceeded. { props . prebuild . error }
373
+ </ span >
374
+ ) ;
371
375
case "failed" :
372
- return " Prebuild failed for system reasons. Please contact support. Error: { prebuild.error}" ;
376
+ return < span > Prebuild failed for system reasons. Please contact support. { props . prebuild . error } </ span > ;
373
377
case "timeout" :
374
- return "Prebuild timed out. Either the image, or the prebuild tasks took too long." ;
378
+ return (
379
+ < span >
380
+ Prebuild timed out. Either the image, or the prebuild tasks took too long. { props . prebuild . error }
381
+ </ span >
382
+ ) ;
375
383
case "available" :
376
- if ( prebuild ?. error ) {
377
- return "The tasks executed in the prebuild returned a non-zero exit code." ;
384
+ if ( props . prebuild ?. error ) {
385
+ return (
386
+ < span >
387
+ The tasks executed in the prebuild returned a non-zero exit code. { props . prebuild . error }
388
+ </ span >
389
+ ) ;
378
390
}
379
- return "Prebuild completed succesfully." ;
391
+ return < span > Prebuild completed succesfully.</ span > ;
392
+ default :
393
+ return < span > Unknown prebuild status.</ span > ;
380
394
}
381
395
}
382
396
@@ -397,12 +411,13 @@ export function PrebuildStatus(props: { prebuild: PrebuildWithStatus }) {
397
411
</ div >
398
412
</ div >
399
413
< div className = "flex space-x-1 items-center text-gray-400" >
400
- < span > { prebuildStatusDescription ( prebuild ) } </ span >
414
+ < PrebuildStatusDescription prebuild = { prebuild } / >
401
415
</ div >
402
416
</ div >
403
417
) ;
404
418
}
405
419
420
+ // Deprecated. Use PrebuildStatus instead.
406
421
export function PrebuildInstanceStatus ( props : { prebuildInstance ?: WorkspaceInstance ; prebuild ?: PrebuildWithStatus } ) {
407
422
let status = < > </ > ;
408
423
let details = < > </ > ;
0 commit comments