Skip to content

Commit 15f3f8e

Browse files
Use State enum as type and transform STATE_UNSPECIFIED to "Unspecified"
Co-authored-by: artemmufazalov <[email protected]>
1 parent e484651 commit 15f3f8e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/containers/Tenants/Tenants.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import {
3535
import {setSearchValue, tenantsApi} from '../../store/reducers/tenants/tenants';
3636
import type {PreparedTenant} from '../../store/reducers/tenants/types';
3737
import type {AdditionalTenantsProps} from '../../types/additionalProps';
38+
import {State} from '../../types/api/tenant';
3839
import {uiFactory} from '../../uiFactory/uiFactory';
3940
import {formatBytes} from '../../utils/bytesParsers';
4041
import {cn} from '../../utils/cn';
@@ -65,14 +66,16 @@ const b = cn('tenants');
6566

6667
const DATABASES_COLUMNS_WIDTH_LS_KEY = 'databasesTableColumnsWidth';
6768

68-
function formatDatabaseState(state?: string): string {
69+
function formatDatabaseState(state?: State): string {
6970
if (!state) {
7071
return EMPTY_DATA_PLACEHOLDER;
7172
}
7273

7374
// Map specific state values to user-friendly display names
7475
switch (state) {
75-
case 'PENDING_RESOURCES':
76+
case State.STATE_UNSPECIFIED:
77+
return 'Unspecified';
78+
case State.PENDING_RESOURCES:
7679
return i18n('value_pending');
7780
default:
7881
// For other states, use capitalized version (first letter uppercase, rest lowercase)

0 commit comments

Comments
 (0)