diff --git a/src/components/Tooltip.tsx b/src/components/Tooltip.tsx index f5802980..9b2eea8b 100644 --- a/src/components/Tooltip.tsx +++ b/src/components/Tooltip.tsx @@ -1,18 +1,10 @@ -import { ReactNode } from 'react'; +import { ComponentProps } from 'react'; import TooltipPrimitive from './primitives/TooltipPrimitive'; -export default function Tooltip({ - children, - content, - className, -}: { - children: ReactNode - content?: ReactNode - className?: string -}) { +export default function Tooltip( + props: ComponentProps, +) { return ( - - {children} - + ); } diff --git a/src/components/primitives/TooltipPrimitive.tsx b/src/components/primitives/TooltipPrimitive.tsx index 015dc601..3b89fbcf 100644 --- a/src/components/primitives/TooltipPrimitive.tsx +++ b/src/components/primitives/TooltipPrimitive.tsx @@ -9,12 +9,14 @@ import useClickInsideOutside from '@/utility/useClickInsideOutside'; export default function TooltipPrimitive({ content, - children, className, + sideOffset = 10, + children, }: { content?: ReactNode - children: ReactNode className?: string + sideOffset?: number + children: ReactNode }) { const refTrigger = useRef(null); const refContent = useRef(null); @@ -46,7 +48,7 @@ export default function TooltipPrimitive({ {photo.focalLengthFormatted} } - {photo.focalLengthIn35MmFormatFormatted && + {( + photo.focalLengthIn35MmFormatFormatted && + // eslint-disable-next-line max-len + photo.focalLengthIn35MmFormatFormatted !== photo.focalLengthFormatted + ) && <> {' '} - - {photo.focalLengthIn35MmFormatFormatted} - + + + {photo.focalLengthIn35MmFormatFormatted} + + }
  • {photo.fNumberFormatted}