import { useState, useCallback, useRef } from 'react'; import { FormattedMessage } from 'react-intl'; import Overlay from 'react-overlays/Overlay'; import type { OffsetValue, UsePopperOptions, } from 'react-overlays/esm/usePopper'; const offset = [0, 4] as OffsetValue; const popperConfig = { strategy: 'fixed' } as UsePopperOptions; export const AltTextBadge: React.FC<{ description: string; }> = ({ description }) => { const anchorRef = useRef(null); const [open, setOpen] = useState(false); const handleClick = useCallback(() => { setOpen((v) => !v); }, [setOpen]); const handleClose = useCallback(() => { setOpen(false); }, [setOpen]); return ( <> {({ props }) => (

{description}

)}
); };