Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/components/tooltip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { cn } from '../../lib/utils'
type TooltipProps = React.ComponentProps<typeof BaseTooltip> & {
className?: string
title: React.ReactNode
disabled?: boolean
} & Pick<React.ComponentProps<typeof TooltipContent>, 'side' | 'sideOffset' | 'align'>

const TooltipContentNoArrow = ({
Expand All @@ -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 (
<BaseTooltip {...props}>
<TooltipTrigger asChild>{children}</TooltipTrigger>
Expand Down