( workspaceStatus: TypesGen.WorkspaceStatus, provisionerJob?: TypesGen.ProvisionerJob, )
| 166 | }; |
| 167 | |
| 168 | export const getDisplayWorkspaceStatus = ( |
| 169 | workspaceStatus: TypesGen.WorkspaceStatus, |
| 170 | provisionerJob?: TypesGen.ProvisionerJob, |
| 171 | ): DisplayWorkspaceStatus => { |
| 172 | switch (workspaceStatus) { |
| 173 | case undefined: |
| 174 | return { |
| 175 | text: "Loading", |
| 176 | type: "active", |
| 177 | icon: <PillSpinner />, |
| 178 | } as const; |
| 179 | case "running": |
| 180 | return { |
| 181 | type: "success", |
| 182 | text: "Running", |
| 183 | icon: <PlayIcon />, |
| 184 | } as const; |
| 185 | case "starting": |
| 186 | return { |
| 187 | type: "active", |
| 188 | text: "Starting", |
| 189 | icon: <PillSpinner />, |
| 190 | } as const; |
| 191 | case "stopping": |
| 192 | return { |
| 193 | type: "inactive", |
| 194 | text: "Stopping", |
| 195 | icon: <PillSpinner />, |
| 196 | } as const; |
| 197 | case "stopped": |
| 198 | return { |
| 199 | type: "inactive", |
| 200 | text: "Stopped", |
| 201 | icon: <SquareIcon />, |
| 202 | } as const; |
| 203 | case "deleting": |
| 204 | return { |
| 205 | type: "danger", |
| 206 | text: "Deleting", |
| 207 | icon: <PillSpinner />, |
| 208 | } as const; |
| 209 | case "deleted": |
| 210 | return { |
| 211 | type: "danger", |
| 212 | text: "Deleted", |
| 213 | icon: <CircleAlertIcon aria-hidden="true" className="size-icon-sm" />, |
| 214 | } as const; |
| 215 | case "canceling": |
| 216 | return { |
| 217 | type: "inactive", |
| 218 | text: "Canceling", |
| 219 | icon: <PillSpinner />, |
| 220 | } as const; |
| 221 | case "canceled": |
| 222 | return { |
| 223 | type: "inactive", |
| 224 | text: "Canceled", |
| 225 | icon: <CircleAlertIcon aria-hidden="true" className="size-icon-sm" />, |
no test coverage detected