Feat: Capitalize the first letter of the team's role #2834 (#3597)

### What problem does this PR solve?

Feat: Capitalize the first letter of the team's role #2834

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu 2024-11-22 18:19:34 +08:00 committed by GitHub
parent 6314d3c727
commit 55692e4da6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,7 @@ import { formatDate } from '@/utils/date';
import { DeleteOutlined } from '@ant-design/icons'; import { DeleteOutlined } from '@ant-design/icons';
import type { TableProps } from 'antd'; import type { TableProps } from 'antd';
import { Button, Table, Tag } from 'antd'; import { Button, Table, Tag } from 'antd';
import { upperFirst } from 'lodash';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { TenantRole } from '../constants'; import { TenantRole } from '../constants';
import { useHandleDeleteUser } from './hooks'; import { useHandleDeleteUser } from './hooks';
@ -36,7 +37,9 @@ const UserTable = () => {
key: 'role', key: 'role',
render(value, { role }) { render(value, { role }) {
return ( return (
<Tag color={ColorMap[role as keyof typeof ColorMap]}>{role}</Tag> <Tag color={ColorMap[role as keyof typeof ColorMap]}>
{upperFirst(role)}
</Tag>
); );
}, },
}, },