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

24 lines
584 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;
}
export class ParagraphWithTooltip extends React.Component<IParagraphWithTooltipProps, any> {
2021-05-01 09:17:31 +02:00
render(): React.ReactNode {
return (
2019-04-14 11:08:10 +02:00
<p className={"tooltip"} style={this.props.style}>
{this.props.content}
<span className={"tooltiptext"}>
{this.props.tooltip}
</span>
</p>
)
}
}