1
- import type { WorkspaceAppStatus } from "api/typesGenerated" ;
1
+ import type { WorkspaceAppStatusState } from "api/typesGenerated" ;
2
2
import { Spinner } from "components/Spinner/Spinner" ;
3
3
import {
4
+ BanIcon ,
4
5
CircleAlertIcon ,
5
6
CircleCheckIcon ,
6
7
HourglassIcon ,
@@ -9,20 +10,22 @@ import {
9
10
import type { FC } from "react" ;
10
11
import { cn } from "utils/cn" ;
11
12
12
- type AppStatusIconProps = {
13
- status : WorkspaceAppStatus ;
13
+ type AppStatusStateIconProps = {
14
+ state : WorkspaceAppStatusState ;
14
15
latest : boolean ;
16
+ disabled ?: boolean ;
15
17
className ?: string ;
16
18
} ;
17
19
18
- export const AppStatusIcon : FC < AppStatusIconProps > = ( {
19
- status,
20
+ export const AppStatusStateIcon : FC < AppStatusStateIconProps > = ( {
21
+ state,
22
+ disabled,
20
23
latest,
21
24
className : customClassName ,
22
25
} ) => {
23
26
const className = cn ( [ "size-4 shrink-0" , customClassName ] ) ;
24
27
25
- switch ( status . state ) {
28
+ switch ( state ) {
26
29
case "complete" :
27
30
return (
28
31
< CircleCheckIcon className = { cn ( [ "text-content-success" , className ] ) } />
@@ -32,10 +35,12 @@ export const AppStatusIcon: FC<AppStatusIconProps> = ({
32
35
< CircleAlertIcon className = { cn ( [ "text-content-warning" , className ] ) } />
33
36
) ;
34
37
case "working" :
35
- return latest ? (
38
+ return disabled ? (
39
+ < BanIcon className = { cn ( [ "text-content-disabled" , className ] ) } />
40
+ ) : latest ? (
36
41
< Spinner size = "sm" className = "shrink-0" loading />
37
42
) : (
38
- < HourglassIcon className = { cn ( [ "text-highlight-sky " , className ] ) } />
43
+ < HourglassIcon className = { cn ( [ "text-content-secondary " , className ] ) } />
39
44
) ;
40
45
default :
41
46
return (
0 commit comments