Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/FoxxMD/multi-scrobbler. Scrobble plays from multiple sources to multiple clients docs.multi-scrobbler.app
deezer docker jellyfin koito lastfm listenbrainz maloja mopidy mpris music music-assistant plex scrobble self-hosted spotify subsonic tautulli youtube-music
Something went wrong. Try again.
1.3 kB · 46 lines
TSX
at strict
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647import { Tooltip as ChakraTooltip, Portal } from "@chakra-ui/react"import * as React from "react"
export interface TooltipProps extends ChakraTooltip.RootProps { showArrow?: boolean portalled?: boolean portalRef?: React.RefObject<HTMLElement | null> content: React.ReactNode contentProps?: ChakraTooltip.ContentProps disabled?: boolean}
export const Tooltip = React.forwardRef<HTMLDivElement, TooltipProps>( function Tooltip(props, ref) { const { showArrow, children, disabled, portalled = true, content, contentProps, portalRef, ...rest } = props
if (disabled) return children
return ( <ChakraTooltip.Root {...rest}> <ChakraTooltip.Trigger asChild>{children}</ChakraTooltip.Trigger> <Portal disabled={!portalled} container={portalRef}> <ChakraTooltip.Positioner> <ChakraTooltip.Content ref={ref} {...contentProps}> {showArrow && ( <ChakraTooltip.Arrow> <ChakraTooltip.ArrowTip /> </ChakraTooltip.Arrow> )} {content} </ChakraTooltip.Content> </ChakraTooltip.Positioner> </Portal> </ChakraTooltip.Root> ) },)