import React, { memo } from "react"; import Tooltip, { TooltipProps } from "../../../components/Tooltip/Tooltip"; import { CLASSPREFIX as eccgui } from "../../../configuration/constants"; export interface HandleContentProps extends Omit, "className"> { /** * Tooltip displayed as overlay on hover. */ extendedTooltip?: React.JSX.Element | string; /** * Configure the tooltip and overwrite automatically set options. */ tooltipProps?: Omit; } export const HandleContent = memo( ({ children, extendedTooltip, tooltipProps, ...otherDivProps }: HandleContentProps) => { const handleContent = children ? (
{children}
) : extendedTooltip ? (
) : ( <> ); if (extendedTooltip) { return ( {handleContent} ); } return handleContent; }, );