import * as React from "react"; interface ITextLineComponentProps { label?: string; value?: string; color?: string; underline?: boolean; onLink?: () => void; url?: string; ignoreValue?: boolean; additionalClass?: string; } export class TextLineComponent extends React.Component { constructor(props: ITextLineComponentProps) { super(props); } onLink() { if (this.props.url) { window.open(this.props.url, '_blank'); return; } if (!this.props.onLink) { return; } this.props.onLink(); } renderContent() { if (this.props.ignoreValue) { return null; } if (this.props.onLink || this.props.url) { return (
this.onLink()}> {this.props.url ? "doc" : (this.props.value || "no name")}
) } return (
{this.props.value || "no name"}
) } render() { return (
{this.props.label ?? ""}
{this.renderContent()}
); } }