11import React from 'react' ;
22
3- import type { PopupProps } from '@gravity-ui/uikit' ;
4- import { Label , Popup } from '@gravity-ui/uikit' ;
3+ import { Label } from '@gravity-ui/uikit' ;
54
65import { selectNodeHostsMap } from '../../store/reducers/nodesList' ;
76import { EFlag } from '../../types/api/enums' ;
@@ -12,7 +11,6 @@ import {stringifyVdiskId} from '../../utils/dataFormatters/dataFormatters';
1211import { isFullVDiskData } from '../../utils/disks/helpers' ;
1312import type { PreparedVDisk , UnavailableDonor } from '../../utils/disks/types' ;
1413import { useTypedSelector } from '../../utils/hooks' ;
15- import { usePopupOpenState } from '../../utils/hooks/usePopupOpenState' ;
1614import { bytesToGB , bytesToSpeed } from '../../utils/utils' ;
1715import type { InfoViewerItem } from '../InfoViewer' ;
1816import { InfoViewer } from '../InfoViewer' ;
@@ -131,17 +129,13 @@ const prepareVDiskData = (data: PreparedVDisk) => {
131129 return vdiskData ;
132130} ;
133131
134- interface VDiskPopupProps extends PopupProps {
132+ interface VDiskPopupProps {
135133 data : PreparedVDisk | UnavailableDonor ;
136- hidePopup ?: VoidFunction ;
137134}
138135
139- export const VDiskPopup = ( { data, hidePopup , ... props } : VDiskPopupProps ) => {
136+ export const VDiskPopup = ( { data} : VDiskPopupProps ) => {
140137 const isFullData = isFullVDiskData ( data ) ;
141138
142- const { open, onMouseEnter, onMouseLeave, onContextMenu, onBlur, onEscapeKeyDown} =
143- usePopupOpenState ( hidePopup ) ;
144-
145139 const vdiskInfo = React . useMemo (
146140 ( ) => ( isFullData ? prepareVDiskData ( data ) : prepareUnavailableVDiskData ( data ) ) ,
147141 [ data , isFullData ] ,
@@ -179,26 +173,11 @@ export const VDiskPopup = ({data, hidePopup, ...props}: VDiskPopupProps) => {
179173 }
180174
181175 return (
182- < Popup
183- contentClassName = { b ( ) }
184- placement = { [ 'top' , 'bottom' ] }
185- hasArrow
186- // bigger offset for easier switching to neighbour nodes
187- // matches the default offset for popup with arrow out of a sense of beauty
188- offset = { [ 0 , 12 ] }
189- onMouseEnter = { onMouseEnter }
190- onMouseLeave = { onMouseLeave }
191- onEscapeKeyDown = { onEscapeKeyDown }
192- onBlur = { onBlur }
193- { ...props }
194- open = { open || props . open }
195- >
196- < div onContextMenu = { onContextMenu } >
197- { data . DonorMode && < Label className = { b ( 'donor-label' ) } > Donor</ Label > }
198- < InfoViewer title = "VDisk" info = { vdiskInfo } size = "s" />
199- { pdiskInfo && < InfoViewer title = "PDisk" info = { pdiskInfo } size = "s" /> }
200- { donorsInfo . length > 0 && < InfoViewer title = "Donors" info = { donorsInfo } size = "s" /> }
201- </ div >
202- </ Popup >
176+ < div className = { b ( ) } >
177+ { data . DonorMode && < Label className = { b ( 'donor-label' ) } > Donor</ Label > }
178+ < InfoViewer title = "VDisk" info = { vdiskInfo } size = "s" />
179+ { pdiskInfo && < InfoViewer title = "PDisk" info = { pdiskInfo } size = "s" /> }
180+ { donorsInfo . length > 0 && < InfoViewer title = "Donors" info = { donorsInfo } size = "s" /> }
181+ </ div >
203182 ) ;
204183} ;
0 commit comments