CoastalCommitsPastes/client/app/components/tooltip/index.tsx

29 lines
586 B
TypeScript
Raw Normal View History

import Card from "@components/card"
2022-11-12 21:39:03 -05:00
import * as RadixTooltip from "@radix-ui/react-tooltip"
import "./tooltip.css"
const Tooltip = ({
children,
content,
className,
...props
}: {
children: React.ReactNode
content: React.ReactNode
className?: string
} & RadixTooltip.TooltipProps) => {
return (
<RadixTooltip.Root {...props}>
<RadixTooltip.Trigger asChild className={className}>
{children}
</RadixTooltip.Trigger>
2022-11-12 21:39:03 -05:00
<RadixTooltip.Content>
<Card className="tooltip">{content}</Card>
2022-11-12 21:39:03 -05:00
</RadixTooltip.Content>
</RadixTooltip.Root>
)
}
export default Tooltip