File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed
webapp/src/ee/billing/administration/subscriptionPlans/migration/general Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -14,18 +14,28 @@ const colors = {
1414 COMPLETED : 'success' ,
1515} ;
1616
17- const translates = {
18- COMPLETED : 'administration_plan_migration_status_completed' ,
19- SCHEDULED : 'administration_plan_migration_status_scheduled' ,
20- } ;
21-
2217export const PlanMigrationStatus = ( { status, date } : Props ) => {
2318 const { t } = useTranslate ( ) ;
2419 const formatDate = useDateFormatter ( ) ;
2520
21+ const getStatusLabel = ( s : Status ) : string => {
22+ switch ( s ) {
23+ case 'COMPLETED' :
24+ return t ( 'administration_plan_migration_status_completed' ) ;
25+ case 'SCHEDULED' :
26+ return t ( 'administration_plan_migration_status_scheduled' ) ;
27+ default :
28+ return String ( s ) ;
29+ }
30+ } ;
31+
2632 const chip = (
27- < Chip label = { t ( translates [ status ] ) } color = { colors [ status ] || 'default' } />
33+ < Chip
34+ label = { getStatusLabel ( status ) }
35+ color = { ( colors as any ) [ status ] || 'default' }
36+ />
2837 ) ;
38+
2939 return date ? (
3040 < Tooltip
3141 title = { formatDate ( date , {
You can’t perform that action at this time.
0 commit comments