The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/client/components/TooltipComponent.tsx

24 lines
572 B

import { Tooltip, PositionAnimated, AnimatedVisibility } from '@rocket.chat/fuselage';
import React, { ReactElement, ReactNode, useRef } from 'react';
type TooltipComponentProps = {
title: ReactNode;
anchor: Element;
};
export const TooltipComponent = ({ title, anchor }: TooltipComponentProps): ReactElement => {
const ref = useRef(anchor);
return (
<PositionAnimated
anchor={ref}
placement='top-middle'
margin={8}
visible={AnimatedVisibility.UNHIDING}
>
<Tooltip>{title}</Tooltip>
</PositionAnimated>
);
};
export default TooltipComponent;