2021-11-18 15:06:23 +05:00
|
|
|
|
import {Tooltip} from 'antd'
|
|
|
|
|
import { UserOutlined } from '@ant-design/icons'
|
|
|
|
|
import { Grid, GridItem } from './Grid'
|
|
|
|
|
import { UserDto } from '../services/api'
|
|
|
|
|
|
|
|
|
|
interface UserViewProps {
|
|
|
|
|
user: UserDto
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const UserView = ({ user } : UserViewProps) => (user ? (
|
|
|
|
|
<Tooltip title={(
|
2021-12-17 10:10:08 +05:00
|
|
|
|
<Grid style={{ columnGap: '8px' }}>
|
2021-11-18 15:06:23 +05:00
|
|
|
|
<GridItem row={1} col={1}>Фамилия:</GridItem>
|
|
|
|
|
<GridItem row={1} col={2}>{user?.surname}</GridItem>
|
|
|
|
|
<GridItem row={2} col={1}>Имя:</GridItem>
|
|
|
|
|
<GridItem row={2} col={2}>{user?.name}</GridItem>
|
|
|
|
|
<GridItem row={3} col={1}>Отчество:</GridItem>
|
|
|
|
|
<GridItem row={3} col={2}>{user?.patronymic}</GridItem>
|
|
|
|
|
<GridItem row={4} col={1}>Компания:</GridItem>
|
|
|
|
|
<GridItem row={4} col={2}>{user?.company?.caption}</GridItem>
|
|
|
|
|
</Grid>
|
|
|
|
|
)}>
|
|
|
|
|
<UserOutlined style={{ marginRight: 8 }}/>
|
|
|
|
|
{user?.login}
|
|
|
|
|
</Tooltip>
|
|
|
|
|
) : (
|
|
|
|
|
<Tooltip title='нет пользователя'>-</Tooltip>
|
|
|
|
|
)
|
|
|
|
|
)
|