main
| 1 | import { Tooltip } from "@medusajs/ui" |
| 2 | import { ComponentPropsWithoutRef, PropsWithChildren } from "react" |
| 3 | |
| 4 | type ConditionalTooltipProps = PropsWithChildren< |
| 5 | ComponentPropsWithoutRef<typeof Tooltip> & { |
| 6 | showTooltip?: boolean |
| 7 | } |
| 8 | > |
| 9 | |
| 10 | export const ConditionalTooltip = ({ |
| 11 | children, |
| 12 | showTooltip = false, |
| 13 | ...props |
| 14 | }: ConditionalTooltipProps) => { |
| 15 | if (showTooltip) { |
| 16 | return <Tooltip {...props}>{children}</Tooltip> |
| 17 | } |
| 18 | |
| 19 | return children |
| 20 | } |