2018-01-01 19:46:28 +00:00
|
|
|
import React from 'react';
|
2018-01-26 20:08:39 +00:00
|
|
|
import classnames from 'classnames';
|
2018-01-01 19:46:28 +00:00
|
|
|
import './Tooltip.scss';
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
children: React.ReactElement<string> | string;
|
2018-01-26 20:08:39 +00:00
|
|
|
size?: 'sm' | 'md' | 'lg';
|
2018-01-01 19:46:28 +00:00
|
|
|
}
|
|
|
|
|
2018-01-26 20:08:39 +00:00
|
|
|
const Tooltip: React.SFC<Props> = ({ size, children }) => (
|
|
|
|
<div
|
|
|
|
className={classnames({
|
|
|
|
Tooltip: true,
|
|
|
|
[`is-size-${size}`]: !!size
|
|
|
|
})}
|
|
|
|
>
|
2018-01-01 19:46:28 +00:00
|
|
|
<span className="Tooltip-text">{children}</span>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
|
|
|
export default Tooltip;
|