tooltipsssssssssss
All checks were successful
Deploy Website / docker (ubuntu-latest) (push) Successful in 2m25s

This commit is contained in:
Lee 2024-10-23 16:44:08 +01:00
parent 0d12e7c024
commit 0731d20edc

@ -34,16 +34,16 @@ type Props = {
export default function Tooltip({ children, display, asChild = true, side = "top", className }: Props) { export default function Tooltip({ children, display, asChild = true, side = "top", className }: Props) {
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const openDebounce = useDebounce(open, 100);
return ( return (
<ShadCnTooltip open={openDebounce}> <ShadCnTooltip open={open}>
<TooltipTrigger className={className} asChild={asChild}> <TooltipTrigger className={className} asChild={asChild}>
<div <div
className={cn("cursor-default", className)} className={cn("cursor-default", className)}
onMouseEnter={() => setOpen(true)} onMouseEnter={() => setOpen(true)}
onMouseLeave={() => setOpen(false)} onMouseLeave={() => setOpen(false)}
onTouchStart={() => setOpen(!open)} onTouchStart={() => setOpen(!open)}
onTouchEnd={() => setOpen(!open)}
> >
{children} {children}
</div> </div>