bitburner-src/src/ui/React/ParagraphWithTooltip.tsx

22 lines
541 B
TypeScript
Raw Normal View History

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