asb_cloud_front/src/components/views/PermissionView.tsx

29 lines
785 B
TypeScript
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { Tooltip } from 'antd'
import { memo } from 'react'
import { PermissionDto } from '@api'
import { Grid, GridItem } from '@components/Grid'
export type PermissionViewProps = {
info?: PermissionDto
}
export const PermissionView = memo<PermissionViewProps>(({ info }) => info ? (
<Tooltip overlayInnerStyle={{ width: '400px' }} title={
<Grid>
<GridItem row={1} col={1}>Название:</GridItem>
<GridItem row={1} col={2}>{info.name}</GridItem>
<GridItem row={2} col={1}>Описание:</GridItem>
<GridItem row={2} col={2}>{info.description}</GridItem>
</Grid>
}>
{info.name}
</Tooltip>
) : (
<Tooltip title={'нет данных'}>-</Tooltip>
))
export default PermissionView