Улучшено позиционирование подсказки о скважине в сообщениях с ошибкой

This commit is contained in:
goodmice 2022-10-06 11:19:56 +05:00
parent 6a97da855d
commit d3fd851e20
No known key found for this signature in database
GPG Key ID: 63EA771203189CF1
2 changed files with 5 additions and 5 deletions

View File

@ -30,7 +30,7 @@ export const notify = (body?: ReactNode, notifyType: NotifyType = 'info', well?:
const message = (
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<span>{instance.message}</span>
<WellView well={well} />
<WellView placement={'leftBottom'} well={well} />
</div>
)

View File

@ -1,5 +1,5 @@
import { memo } from 'react'
import { Tooltip } from 'antd'
import { Tooltip, TooltipProps } from 'antd'
import { Grid, GridItem } from '@components/Grid'
import { WellIcon, WellIconState } from '@components/icons'
@ -13,12 +13,12 @@ const wellState: Record<number, { enum: WellIconState, label: string }> = {
2: { enum: 'inactive', label: 'Завершена' },
}
export type WellViewProps = {
export type WellViewProps = TooltipProps & {
well?: WellDto
}
export const WellView = memo<WellViewProps>(({ well }) => well ? (
<Tooltip title={(
export const WellView = memo<WellViewProps>(({ well, ...other }) => well ? (
<Tooltip {...other} title={(
<Grid style={{ columnGap: '8px' }}>
<GridItem row={1} col={1}>Название:</GridItem>
<GridItem row={1} col={2}>{well.caption ?? '---'}</GridItem>