From 4c3ff70f8f7c83b8c1dc369fbe9d2de7e89b6243 Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Mon, 3 Nov 2025 09:24:07 +0100 Subject: [PATCH] Allow to disable Tooltip component --- src/components/tooltip/index.tsx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/components/tooltip/index.tsx b/src/components/tooltip/index.tsx index 1fa94ffa..cd139e2a 100644 --- a/src/components/tooltip/index.tsx +++ b/src/components/tooltip/index.tsx @@ -5,6 +5,7 @@ import { cn } from '../../lib/utils' type TooltipProps = React.ComponentProps & { className?: string title: React.ReactNode + disabled?: boolean } & Pick, 'side' | 'sideOffset' | 'align'> const TooltipContentNoArrow = ({ @@ -27,7 +28,20 @@ const TooltipContentNoArrow = ({ ) } -export const Tooltip = ({ className, title, children, side, sideOffset, align, ...props }: TooltipProps) => { +export const Tooltip = ({ + className, + title, + children, + side, + sideOffset, + align, + disabled = false, + ...props +}: TooltipProps) => { + if (disabled) { + return <>{children} + } + return ( {children}