lbry-desktop/ui/component/common/tooltip.jsx

21 lines
340 B
React
Raw Normal View History

2018-03-26 23:32:43 +02:00
// @flow
import type { Node } from 'react';
import React from 'react';
2018-03-26 23:32:43 +02:00
type Props = {
label: string | Node,
children: Node,
2018-03-26 23:32:43 +02:00
};
function Tooltip(props: Props) {
const { children, label } = props;
2018-03-26 23:32:43 +02:00
if (typeof label !== 'string') {
return children;
}
return <span title={label}>{children}</span>;
2018-03-26 23:32:43 +02:00
}
export default Tooltip;