bitburner-src/src/ui/React/ParagraphWithTooltip.tsx
2021-09-08 23:47:34 -04:00

22 lines
541 B
TypeScript

/**
* Text (p Element) with Tooltip
*/
import * as React from "react";
export interface IParagraphWithTooltipProps {
style?: any;
content: JSX.Element;
tooltip: string | React.ReactElement | JSX.Element;
}
export class ParagraphWithTooltip extends React.Component<IParagraphWithTooltipProps, any> {
render(): React.ReactNode {
return (
<div className={"tooltip"} style={this.props.style}>
<p>{this.props.content}</p>
<span className={"tooltiptext"}>{this.props.tooltip}</span>
</div>
);
}
}