Files
Ghom 291dcf9515 Merge pull request #10575 from Arturlang/TGUIs_Nexties
[TESTMERGE] Properly working TGUI Next
2021-01-04 19:47:54 -03:00

21 lines
493 B
JavaScript

import { classes } from 'common/react';
export const Tooltip = props => {
const {
content,
position = 'bottom',
} = props;
// Empirically calculated length of the string,
// at which tooltip text starts to overflow.
const long = typeof content === 'string' && content.length > 35;
return (
<div
className={classes([
'Tooltip',
long && 'Tooltip--long',
position && 'Tooltip--' + position,
])}
data-tooltip={content} />
);
};