2021-11-16 16:11:18 +02:00
|
|
|
import ReactTooltip from 'react-tooltip';
|
2022-06-23 09:32:18 +03:00
|
|
|
import { HelpCircle } from 'react-feather';
|
2021-11-16 16:11:18 +02:00
|
|
|
|
|
|
|
import styles from './Tooltip.module.css';
|
|
|
|
|
|
|
|
type Place = 'top' | 'right' | 'bottom' | 'left';
|
|
|
|
|
|
|
|
export interface Props {
|
|
|
|
position?: Place;
|
|
|
|
message: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function Tooltip({ message, position = 'bottom' }: Props) {
|
|
|
|
return (
|
2022-06-23 09:32:18 +03:00
|
|
|
<span data-tip={message} className={styles.icon}>
|
|
|
|
<HelpCircle className="feather" aria-hidden="true" />
|
2021-11-16 16:11:18 +02:00
|
|
|
<ReactTooltip
|
|
|
|
multiline
|
|
|
|
type="info"
|
|
|
|
place={position}
|
|
|
|
effect="solid"
|
|
|
|
className={styles.tooltip}
|
|
|
|
arrowColor="transparent"
|
|
|
|
/>
|
|
|
|
</span>
|
|
|
|
);
|
|
|
|
}
|