22 @license
33 Copyright (c) 2015-2026 Lablup Inc. All rights reserved.
44 */
5- import { BadgeProps } from 'antd' ;
6- import { BAIBadge , SemanticColor } from 'backend.ai-ui' ;
5+ import type { TagProps } from 'antd' ;
6+ import { BAITag , type SemanticColor } from 'backend.ai-ui' ;
77import React from 'react' ;
88import { useTranslation } from 'react-i18next' ;
99
@@ -21,14 +21,14 @@ export type DeploymentStatus =
2121 | 'READY' ;
2222
2323/**
24- * Maps each deployment status to a semantic color.
24+ * Maps each deployment status to a Tag color.
2525 *
26- * - success: HEALTHY, READY — the deployment is fully operational.
27- * - info : DEPLOYING, SCALING, PENDING — transient, in-flight states.
28- * - warning: DEGRADED, UNHEALTHY, STOPPING — user attention needed or transitioning away.
29- * - default: NOT_CHECKED, STOPPED, TERMINATED — neutral / inactive / pre-check states .
26+ * - success: HEALTHY, READY — fully operational.
27+ * - processing : DEPLOYING, SCALING, PENDING — transient, in-flight states.
28+ * - warning: DEGRADED, UNHEALTHY, STOPPING — attention needed or transitioning away.
29+ * - default: NOT_CHECKED, STOPPED, TERMINATED — neutral / inactive.
3030 */
31- const deploymentStatusSemanticMap : Record < DeploymentStatus , SemanticColor > = {
31+ const deploymentStatusColorMap : Record < DeploymentStatus , SemanticColor > = {
3232 HEALTHY : 'success' ,
3333 READY : 'success' ,
3434 DEPLOYING : 'info' ,
@@ -42,15 +42,6 @@ const deploymentStatusSemanticMap: Record<DeploymentStatus, SemanticColor> = {
4242 TERMINATED : 'default' ,
4343} ;
4444
45- /**
46- * In-flight statuses that should render with the processing ripple animation.
47- */
48- const processingStatuses : ReadonlySet < DeploymentStatus > =
49- new Set < DeploymentStatus > ( [ 'DEPLOYING' , 'SCALING' , 'STOPPING' ] ) ;
50-
51- /**
52- * Maps each deployment status to its i18n translation key under `deployment.status.*`.
53- */
5445const deploymentStatusI18nMap : Record < DeploymentStatus , string > = {
5546 HEALTHY : 'deployment.status.Healthy' ,
5647 UNHEALTHY : 'deployment.status.Unhealthy' ,
@@ -65,10 +56,7 @@ const deploymentStatusI18nMap: Record<DeploymentStatus, string> = {
6556 READY : 'deployment.status.Ready' ,
6657} ;
6758
68- export interface DeploymentStatusTagProps extends Omit <
69- BadgeProps ,
70- 'color' | 'status' | 'styles' | 'text'
71- > {
59+ export interface DeploymentStatusTagProps extends Omit < TagProps , 'color' > {
7260 /**
7361 * The deployment-level status to display. Consolidates lifecycle (e.g.
7462 * `DEPLOYING`, `STOPPED`, `TERMINATED`) and health (e.g. `HEALTHY`,
@@ -78,26 +66,20 @@ export interface DeploymentStatusTagProps extends Omit<
7866}
7967
8068/**
81- * DeploymentStatusTag — consolidated lifecycle + health status badge for a
69+ * DeploymentStatusTag — consolidated lifecycle + health status tag for a
8270 * deployment. Used in list rows and detail page headers.
83- *
84- * In-flight states (`DEPLOYING`, `SCALING`, `STOPPING`) automatically render
85- * with a processing ripple animation.
8671 */
8772const DeploymentStatusTag : React . FC < DeploymentStatusTagProps > = ( {
8873 status,
89- ...badgeProps
74+ ...tagProps
9075} ) => {
9176 'use memo' ;
9277 const { t } = useTranslation ( ) ;
9378
9479 return (
95- < BAIBadge
96- { ...badgeProps }
97- color = { deploymentStatusSemanticMap [ status ] }
98- processing = { processingStatuses . has ( status ) }
99- text = { t ( deploymentStatusI18nMap [ status ] ) }
100- />
80+ < BAITag { ...tagProps } color = { deploymentStatusColorMap [ status ] } >
81+ { t ( deploymentStatusI18nMap [ status ] ) }
82+ </ BAITag >
10183 ) ;
10284} ;
10385
0 commit comments