asb_cloud_front/src/components/UserView.jsx

43 lines
1004 B
React
Raw Normal View History

2021-08-31 12:30:03 +05:00
import {Tooltip} from 'antd'
import {UserOutlined} from '@ant-design/icons'
import {Grid, GridItem} from './Grid'
2021-08-31 12:30:03 +05:00
export const UserView = ({user}) => {
if(!user)
return <Tooltip title='нет пользователя'>-</Tooltip>
const displayName = user?.login
const tooltipInfo = <Grid columnGap='8px'>
<GridItem row={1} col={1}>
Имя:
</GridItem>
<GridItem row={1} col={2}>
2021-08-31 12:30:03 +05:00
{user?.name}
</GridItem>
<GridItem row={2} col={1}>
Фамилия:
</GridItem>
<GridItem row={3} col={2}>
2021-08-31 12:30:03 +05:00
{user?.surname}
</GridItem>
<GridItem row={3} col={1}>
Отчество:
</GridItem>
<GridItem row={3} col={2}>
2021-08-31 12:30:03 +05:00
{user?.patronymic}
</GridItem>
<GridItem row={4} col={1}>
Компания:
</GridItem>
<GridItem row={4} col={2}>
{user?.company?.caption}
</GridItem>
</Grid>
2021-08-31 12:30:03 +05:00
return <Tooltip title={tooltipInfo}>
<UserOutlined style={{marginRight:8}}/>
2021-08-31 12:30:03 +05:00
{displayName}
</Tooltip>
}