diff --git a/platform/wab/src/wab/client/components/widgets/InfoTooltip.tsx b/platform/wab/src/wab/client/components/widgets/InfoTooltip.tsx new file mode 100644 index 00000000000..8a727b4aa9c --- /dev/null +++ b/platform/wab/src/wab/client/components/widgets/InfoTooltip.tsx @@ -0,0 +1,30 @@ +import { InlineIcon } from "@/wab/client/components/widgets"; +import { Icon } from "@/wab/client/components/widgets/Icon"; +import InfoIcon from "@/wab/client/plasmic/plasmic_kit/PlasmicIcon__Info"; +import { Popover } from "antd"; +import { isFunction } from "lodash"; +import React, { ReactNode } from "react"; + +export type InfoTooltipProps = { + tooltip: ReactNode | (() => React.ReactNode); +}; + +export function InfoTooltip({ tooltip }: InfoTooltipProps) { + return ( + + ( +
+ {isFunction(tooltip) ? tooltip() : tooltip} +
+ )} + > + +
+
+ ); +} diff --git a/platform/wab/src/wab/client/components/widgets/LabelWithDetailedTooltip.tsx b/platform/wab/src/wab/client/components/widgets/LabelWithDetailedTooltip.tsx index d1a4f29ce9c..cb104eb9439 100644 --- a/platform/wab/src/wab/client/components/widgets/LabelWithDetailedTooltip.tsx +++ b/platform/wab/src/wab/client/components/widgets/LabelWithDetailedTooltip.tsx @@ -1,8 +1,4 @@ -import { InlineIcon } from "@/wab/client/components/widgets"; -import { Icon } from "@/wab/client/components/widgets/Icon"; -import InfoIcon from "@/wab/client/plasmic/plasmic_kit/PlasmicIcon__Info"; -import { Popover } from "antd"; -import { isFunction } from "lodash"; +import { InfoTooltip } from "@/wab/client/components/widgets/InfoTooltip"; import React, { ReactNode } from "react"; export function LabelWithDetailedTooltip(props: { @@ -13,21 +9,7 @@ export function LabelWithDetailedTooltip(props: {
{props.children}
- - ( -
- {isFunction(props.tooltip) ? props.tooltip() : props.tooltip} -
- )} - > - -
-
+
);