Skip to content

Commit

Permalink
fix(types): fix value inspector button warning (#17876)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Matloka <[email protected]>
  • Loading branch information
thmsobrmlr and Twixes authored Oct 11, 2023
1 parent 301ab02 commit 8bc9602
Showing 1 changed file with 29 additions and 28 deletions.
57 changes: 29 additions & 28 deletions frontend/src/scenes/funnels/ValueInspectorButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { forwardRef } from 'react'

import { Link } from '@posthog/lemon-ui'
import React from 'react'

interface ValueInspectorButtonProps {
onClick?: (e?: React.MouseEvent) => void
Expand All @@ -9,30 +10,30 @@ interface ValueInspectorButtonProps {
title?: string | undefined
}

export const ValueInspectorButton = React.forwardRef<HTMLElement, ValueInspectorButtonProps>(
({ onClick, onMouseEnter, onMouseLeave, children, title }, ref) => {
return onClick ? (
<Link
ref={ref}
onClick={onClick}
onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave}
className="funnel-inspect-button"
title={title}
>
{children}
</Link>
) : (
<span
ref={ref}
onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave}
className="funnel-inspect-button"
title={title}
>
{children}
</span>
)
}
)
ValueInspectorButton.displayName = 'ValueInspectorButton'
export const ValueInspectorButton = forwardRef<HTMLElement, ValueInspectorButtonProps>(function ValueInspectorButton(
{ onClick, onMouseEnter, onMouseLeave, children, title },
ref
): JSX.Element {
return onClick ? (
<Link
ref={ref}
onClick={onClick}
onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave}
className="funnel-inspect-button"
title={title}
>
{children}
</Link>
) : (
<span
ref={ref}
onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave}
className="funnel-inspect-button"
title={title}
>
{children}
</span>
)
})

0 comments on commit 8bc9602

Please sign in to comment.