diff --git a/portal-ui/src/screens/Console/Common/TooltipWrapper/TooltipWrapper.tsx b/portal-ui/src/screens/Console/Common/TooltipWrapper/TooltipWrapper.tsx index 145d9aeae..2243255d4 100644 --- a/portal-ui/src/screens/Console/Common/TooltipWrapper/TooltipWrapper.tsx +++ b/portal-ui/src/screens/Console/Common/TooltipWrapper/TooltipWrapper.tsx @@ -14,18 +14,25 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -import React from "react"; +import React, { cloneElement } from "react"; import { Tooltip } from "@mui/material"; interface ITooltipWrapperProps { tooltip: string; children: any; + errorProps?: any; } -const TooltipWrapper = ({ tooltip, children }: ITooltipWrapperProps) => { +const TooltipWrapper = ({ + tooltip, + children, + errorProps = null, +}: ITooltipWrapperProps) => { return ( - {children} + + {errorProps ? cloneElement(children, { ...errorProps }) : children} + ); };