Skip to content

Commit 72ae86a

Browse files
committed
chore: check-translations fix
1 parent af75b99 commit 72ae86a

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

webapp/src/ee/billing/administration/subscriptionPlans/migration/general/PlanMigrationStatus.tsx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff 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-
2217
export 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, {

0 commit comments

Comments
 (0)