- Fixed nullable searchParams with optional chaining and fallbacks - Fixed recency type handling (string from URL, number internally) - Removed duplicate Party/User interface definitions, use global types - Fixed error handling in API routes with proper type checking - Fixed props access in UI components (placeholder, content types) - Added missing required props to components - Fixed type mismatches with next-intl rich text interpolation
33 lines
910 B
TypeScript
33 lines
910 B
TypeScript
import React, { PropsWithChildren } from 'react'
|
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip'
|
|
|
|
import styles from './index.module.scss'
|
|
interface Props extends Omit<TooltipPrimitive.TooltipContentProps, 'content'> {
|
|
content: React.ReactNode
|
|
open?: boolean
|
|
onOpenChange?: (open: boolean) => void
|
|
}
|
|
|
|
export default function Tooltip({
|
|
children,
|
|
content,
|
|
open,
|
|
onOpenChange,
|
|
...props
|
|
}: PropsWithChildren<Props>) {
|
|
return (
|
|
<TooltipPrimitive.Root open={open} onOpenChange={onOpenChange}>
|
|
<TooltipPrimitive.Trigger asChild>{children}</TooltipPrimitive.Trigger>
|
|
<TooltipPrimitive.Content
|
|
side="top"
|
|
align="center"
|
|
className={styles.tooltip}
|
|
sideOffset={4}
|
|
{...props}
|
|
>
|
|
{content}
|
|
{/* <TooltipPrimitive.Arrow width={11} height={5} /> */}
|
|
</TooltipPrimitive.Content>
|
|
</TooltipPrimitive.Root>
|
|
)
|
|
}
|