import React from 'react'; import { XAxis } from 'recharts'; import {GripIcon} from '../Icons'; import usePrevious from '../utils/usePrevious'; export interface ToolBarProps { displayMode?: 'visible' | 'hover' | 'hidden'; style?: any; //TODO if function } export type Props = ToolBarProps; export const ToolBar = (props: any) => { const {customizedProps, displayMode, style} = props; const toolbarRef = React.useRef(null); const [toolbarDimentions, setToolbarDimentions] = React.useState({width: 0, height: 0}) const prevDimentions = usePrevious(toolbarDimentions); const [hover, setHover] = React.useState(false); React.useEffect(() => { if (toolbarRef?.current) {// && prevDimentions != toolbarDimentions const current = toolbarRef.current setToolbarDimentions({width: current.offsetWidth, height: current.offsetHeight}); } }, [toolbarRef?.current]) return (