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

24 lines
630 B
TypeScript
Raw Normal View History

/**
* Text (p Element) with Tooltip
*/
import * as React from "react";
export interface IParagraphWithTooltipProps {
2021-05-01 09:17:31 +02:00
style?: any;
content: JSX.Element;
tooltip: string | React.ReactElement | JSX.Element;
}
export class ParagraphWithTooltip extends React.Component<IParagraphWithTooltipProps, any> {
2021-05-01 09:17:31 +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>
)
}
}