Skip to content

Commit e49a30b

Browse files
committed
fix
1 parent cddffa3 commit e49a30b

File tree

1 file changed

+27
-12
lines changed

1 file changed

+27
-12
lines changed

components/dashboard/src/projects/Prebuilds.tsx

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -359,24 +359,38 @@ export function prebuildStatusIcon(prebuild?: PrebuildWithStatus) {
359359
}
360360
}
361361

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) {
365364
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>;
367366
case "building":
368-
return "Prebuild is currently in progress.";
367+
return <span>Prebuild is currently in progress.</span>;
369368
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+
);
371375
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>;
373377
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+
);
375383
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+
);
378390
}
379-
return "Prebuild completed succesfully.";
391+
return <span>Prebuild completed succesfully.</span>;
392+
default:
393+
return <span>Unknown prebuild status.</span>;
380394
}
381395
}
382396

@@ -397,12 +411,13 @@ export function PrebuildStatus(props: { prebuild: PrebuildWithStatus }) {
397411
</div>
398412
</div>
399413
<div className="flex space-x-1 items-center text-gray-400">
400-
<span>{prebuildStatusDescription(prebuild)}</span>
414+
<PrebuildStatusDescription prebuild={prebuild} />
401415
</div>
402416
</div>
403417
);
404418
}
405419

420+
// Deprecated. Use PrebuildStatus instead.
406421
export function PrebuildInstanceStatus(props: { prebuildInstance?: WorkspaceInstance; prebuild?: PrebuildWithStatus }) {
407422
let status = <></>;
408423
let details = <></>;

0 commit comments

Comments
 (0)